This is the script
path=/oracle/ora10gdb/sample
archive=/oracle/ora10gdb/archive
cd $path
for i in `ls`;do
mv $i $archive
Done
Please tell me why it is givind this error
This is the script
path=/oracle/ora10gdb/sample
archive=/oracle/ora10gdb/archive
cd $path
for i in `ls`;do
mv $i $archive
Done
Please tell me why it is givind this error
The code what you have written is absolutely correct ...and it is not giving any errors.
i tried with your code by creating the files in my home directory....
Please segregate the do part from the line whre you are putting the semicolon..
can you tell me in which operating system you are working ...(may be it depends upon the o/s)
Try with this it will transfer the file .....
from one directory to another
path=/oracle/ora10gdb/sample
archive=/oracle/ora10gdb/archive
cd $path
echo `pwd`
for file in `ls`
do
mv $file $archive
done
'Done' must be in lowercase.
Also the code choice is very poor, it will break fo any file with a space in it.
for file in * ; do
mv "$i" "$srchive"
done