![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
|
Help Me!!
HEEELLLLPPPP!!!!
I've been developing a basic suite of apps to get to know Shell Scripting in Fedora 1 Linux. I have 2 applications done and bug-free, but my third is no... here is the code: #-------------Credits------------
# (C) 2005 Kid Kompany
# Written by Chris Szentkiralyi
# v1.5
#--------------------------------
#!/bin/sh
makeDir() {
if mkdir "_$dir"
then
echo "Directory _$dir created..."
else
echo "ERROR: Directory could not be created"
fi
}
changeDir() {
if cd "_$dir"
then
echo "Directory changed to $dir"
else
ECHO "ERROR: Directory could not be changed"
fi
}
copyFiles() {
if cp *.* _$dir
then
echo "Files copied to _$dir"
else
echo "ERROR: Could not copy files to _$dir"
fi
}
read dir
makeDir
changeDir
copyFiles
__________________
Signed, Magyarkid |
|
|
|
|
|
#2 |
|
PFO Founder
![]() ![]() |
just try a * and not *.* not all files in linux have a ext so just do the *
![]()
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#3 |
|
Newbie
|
Oh... but this is an all-perpouse utitlity... so what happens if it ran into, say, 'file.ext'? Would the * work for that? Or would it have to be *.*?
__________________
Signed, Magyarkid |
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
It works whether or not the file has an extension. Go for it.
|
|
|
|
|
|
#5 |
|
Newbie
|
OK. Thanks, Ooble and big_k105!
NOTE: I can't edit my first post to add [solved]... the EDIT buttons are on my other posts, but not the first one...
__________________
Signed, Magyarkid Last edited by magyarkid; Feb 17th, 2005 at 7:41 AM. |
|
|
|
|
|
#6 |
|
Newbie
|
Great.... the files were copied... and it works. But it still gives me this:
cp: cannot stat `*': No such file or directory
__________________
Signed, Magyarkid |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|