On 2010-04-08 03:03, Mart Frauenlob wrote:
On 08.04.2010 00:49, Ron Johnson wrote:
On 2010-04-07 16:12, Ron Johnson wrote:
[snip]
Mart's method is the shell way. The 3GL Way is:
grep -w "$NAME" "$FILE"
TMP=$?
if [ "$TMP" = "1" ];
That should be:
if [ "$TMP" = "0" ];
then
echo -e "$NAME\n" >> "$FILE"
fi
nope, the OP wanted 'if $NAME is NOT found in file, ...'
Correct. grep return 1 if it *is* found.
--
"History does not long entrust the care of freedom to the weak
or the timid." Dwight Eisenhower
--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4bbdd1fa.7000...@cox.net