Results 1 to 2 of 2
I have give a simple shell script to copy a tar file from a folder to other folder
SRC_DIR = /home/abcd
DEST_DIR=/home/kf/log/
cd $SRC_DIR
cp *.tar $DEST_DIR
but log directory ...
- 07-23-2011 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 85
Strange problem with simple copy command in HP linux
I have give a simple shell script to copy a tar file from a folder to other folder
SRC_DIR = /home/abcd
DEST_DIR=/home/kf/log/
cd $SRC_DIR
cp *.tar $DEST_DIR
but log directory is not present in the system
once I execute the script, I find that cp is success and it is creating a file with the log of size 0, why it copies the file with the last folder name. Im puzzled with this behaviour. can anyone help me in this
Thanks in advance.
- 07-23-2011 #2
I'm not the best at scripting, so not sure what help I'll be.
Have you tried creating the destination directory, and then running your script?
When you say it created a file of 'size 0'... is it a file? Or is it an empty directory?Jay
New users, read this first.
New Member FAQ
Registered Linux User #463940
I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.


Reply With Quote