07-22-05 10:55 PM
joe@invalid.address wrote:
> "James" <bob_then@yahoo.com.au> writes:
>
>
>
>
> That's a good way to test things. Another way is to try the parts of
> the script on the command line. In this case,
>
> $ for d in dirB/*;do echo "$d";done
>
> would show you that "dirB/" is part of what's returned. What you want
> d to be is just the file name. That can be gotten with the basename
> command. Try instead
>
> for d in dirB/*; do
> d=`basename "$d"`
> if [ -f dirA/"$d" ]
> then
> echo "$d"
> fi
> done
>
> Joe
Do you understand that all you will indentify with this loop is the
files that are common to A and B. What you want to identify is]
files that are not in B. So, you should go through the list
of files in A. If the files DO NOT exist in B then erase them.
--
Fletcher Glenn
[ Post a follow-up to this message ]
|