move files - Unix

This is a discussion on move files - Unix ; How would I move files to a directory only if that file doesn't already exist there using a bourne shell script?...

+ Reply to Thread
Results 1 to 2 of 2

Thread: move files

  1. move files

    How would I move files to a directory only if that file doesn't already
    exist there using a bourne shell script?



  2. Re: move files

    On 2005-07-25, Greg wrote:
    > How would I move files to a directory only if that file doesn't already
    > exist there using a bourne shell script?


    [ -f "$newdir/$file" ] || mv "$file" "$newdir"


    --
    Chris F.A. Johnson
    ================================================== ================
    Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress


+ Reply to Thread