Re: So that's what they're for.
From: Tim Haynes (usenet-20031128_at_stirfried.vegetable.org.uk)
Date: 11/28/03
- Previous message: Chris F.A. Johnson: "Re: So that's what they're for."
- In reply to: Chris F.A. Johnson: "Re: So that's what they're for."
- Next in thread: Chris F.A. Johnson: "Re: So that's what they're for."
- Reply: Chris F.A. Johnson: "Re: So that's what they're for."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 28 Nov 2003 11:28:40 +0000
"Chris F.A. Johnson" <c.fa.johnson@rogers.com> writes:
> First, don't call external commands when there are internal
> commands or syntax to accomplish the same thing. E.g.:
>
> NEWSIG=$(( $RANDOM * $NUMSIGS / 32767 ))
Of course, this might not be readily portable to all shells the user wants.
`expr' and/or `bc' might be worthwhile playing with.
> Second, when external commands are necessary, don't call more
> of them than absolutely necessary:
>
> NUMSIGS=`grep ^# ~/.siglist | wc -l`
Says you, when you could've suggested
NUMSIGS=$(grep -c "^#" ~/.siglist)
instead ;8)
~Tim
-- No more sun, No more wind |piglet@stirfried.vegetable.org.uk Only this strange feeling |http://spodzone.org.uk/cesspit/ Living without moving |
- Previous message: Chris F.A. Johnson: "Re: So that's what they're for."
- In reply to: Chris F.A. Johnson: "Re: So that's what they're for."
- Next in thread: Chris F.A. Johnson: "Re: So that's what they're for."
- Reply: Chris F.A. Johnson: "Re: So that's what they're for."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|