On Wed, 12 Dec 2001, David Talkington wrote: > >> var2=`/usr/bin/id -u $var1` > > > >Check the exit status here. > > > > if [ $? -eq 1 ]; then # Does not exist ... > > That's an unnecessary extra step. This will do: > > $ var=`id -u pepe` || echo "Sorry."
It all depends. The first example posted showed more code (for testing UID range) plus it indicated that the script will be doing other work too. It is often easier and cleaner to use "if" statements than trying to place a bunch of code within parenthesis for example. || (echo "Sorry." ; and what about the rest ; should this exit here; jump \ to there ; etc. ) So instead of faultfinding, maybe consider something like "Here's an another idea ..." > -----BEGIN PGP SIGNATURE----- And some would say this is unnecessary :) Jeremy C. Reed FAQs for ISPs http://www.isp-faq.com/ _______________________________________________ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list