Find the answer to your Linux question:
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 ...
  1. #1
    Just 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.

  2. #2
    Trusted Penguin jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    4,071
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...