[CLUE-Tech] Just a little help?
Dale K. Hawkins
dhawkins at cdrgts.com
Thu Jan 15 06:49:16 MST 2004
I hate to keep bring it up, but what are you _really_ trying to
accomplish?
Depending on what you are trying to do, there is most likely already a
tool out which does it much, much better (debugged, thorough, etc.)
If you are trying to compare some directories, wouldn't you simply use
diff?
For example would
$ diff -q /home/dlwillson /backup/dlwillson
do what you want?
What about rsync in dry-run mode?
$ rsync -n -av /home/dlwillson /backup/dlwillson
For all my experience with UNIX, I have learned that laziness is still
a very strong motivator. Listen to your inner bum! :-)
That being sed (or said), is will this work for you?
--------------------8<--------------------
#!/bin/bash
src=/home/dhawkins/tmp
dst=/tmp
for dn in `find $src -type d | sed "s@$src@$dst at g"`
do
test -d $dn || echo $dn
done
--------------------8<--------------------
-Dale
David Willson <DLWillson at TheGeek.NU> writes:
> I got the hard part done. Or so it seems. I have written a script that will
> replace a 'source' directory's name in all the found directory-names with a
> target directory's name. Now, I want to test each line of output for
> directory-ness, and record the source directory that doesn't have a matching target.
More information about the clue-tech
mailing list