C Shell problems
I'm having problems getting a C Shell script to work. The script is supposed to take all the files in a directory and transfer them to another directory. Simple enough, right? Well, when I execute the script, it just acts like the copy command isn't even there. When I use that very same command at the prompt, it works perfectly. Is there anything I need to put in the script besides the copy command to make this work? Any help is much appreciated...
A C shell script? Do you mean bash? Anyway paste your script. Just a thought but you might have to set the patch to cp in the script before executing it.
Something like this maybe..
# Directory where your files are located
# Directory to where the files should be copied.
if [ -d $FILEDIR ]
FILES=`find . -type f`
echo "Filedir:$FILEDIR doesnt exist"
for i in $FILES
echo "Copying $i to $DESTDIR"
cp $i $DESTDIR
if [ $? = 0 ]
echo "Copy failed"
cp -R /tmp/filedir/* /tmp/otherdir