NON-SOURCE POSTINGS CONSIDERED HARMFUL!

Dik T. Winter dik at cwi.nl
Sun Jan 27 13:27:34 AEST 1991


Now I thought that the discussion was about a script/program that acted which-
like and pointed to duplicates.  Dan moves on to another field giving a script
that gives all duplicate executables in your path; it does not look at the
arguments you give.

I have a few complaints (and than thinking that Dan complained that the perl
script was not portable!).  A number of these already apply to Dan's one-
liners (did you program APL originally?).

In article <1943:Jan2619:34:3591 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
...
 > for i in `ls -ilFL $dirs |
Complaint 1:  ls complains about non existing directories that I have in my
path.  I know I have them, my base path is identical on all machines I have
access to.  So this should be changed to:
   for i in `(ls -ilFL $dirs 2>/dev/null) |
(And as noted already the -L flag is illegal on some (UNIX) systems.)
 >                            rev |
Complaint 2: some of the (UNIX) systems I have access to tell me:
	rev not found.
What do I do now?  Write a csh alias to do rev?
 >                                  sort -u \
Looks correct.
 > | sed -n -e 's/ .*//' -e 's/^\*//p' |
Complaint 3: Mmm.  What with a filename that ends in an asterisk?  And
files with embedded blanks?  (And do not come with the answer that people
should not have files with such names, because people do have them.  Just
like they have '.' in their path.  Be robust, just as in another thread:
There should be no limits.)
 >                                       uniq -d | rev`; do
Looks correct (except for rev of course).
 >   echo -n "$i: "
Complaint 4:  On some (UNIX) systems this will not echo what you want.  But
than you have already a problem with rev of course.
 >   for j in $dirs; do
Correct again.
 >     test -f "$j/$i" && echo -n "$j/$i "
Same complaint about echo.
 >   done
Correct.
 >   echo ''
Why those quotes?
 > done
Correct again.

Score: 8 lines of code, 3 correct.  Dan, Dan, you ought to do better.
--
dik t. winter, cwi, amsterdam, nederland
dik at cwi.nl



More information about the Alt.sources.d mailing list