What Will This Return?



I do not have a UNIX enviroment to test in and I am a windows
developer. Please help me with this simple question.

Thanks,
Will

NonEmptyFiles=$( find /usr/edit/*.phy -type f -size +0 )

If I have two files (/usr/edit/01.phy & /usr/edit/02.phy)
If I execute the statement above from user/bin will it return:

/usr/edit/01.phy
/usr/edit/02.phy

OR

01.phy
02.phy


So later when I refernce the files from user/bin do i need to do this:

for EachFile in $NonEmptyFiles
do
TimeStamp=`date "+%Y%m%d%H%M"`
cp $EachFile $EachFile$TimeStamp.dat
done

OR

for EachFile in $NonEmptyFiles
do
TimeStamp=`date "+%Y%m%d%H%M"`
cp /usr/edit/$EachFile /usr/edit/$EachFile$TimeStamp.dat
done

.



Relevant Pages

  • Re: What Will This Return?
    ... You could install Cygwin or use a live CD. ... If I execute the statement above from user/bin will it return: ... cp $EachFile $EachFile$TimeStamp.dat ...
    (comp.unix.shell)
  • Re: What Will This Return?
    ... cp $EachFile $EachFile$TimeStamp.dat ... No, with $NonEmptyFiles unquoted above, you're asking the shell ... filename generation, aka globbing (that is expansion of patterns ... if phy files may also be something else than regular files ...
    (comp.unix.shell)