Re: OT: Script to add line to file if it doesn't exist
- From: Eduardo M KALINOWSKI <eduardo@xxxxxxxxxxxxxxxxx>
- Date: Wed, 07 Apr 2010 18:56:18 -0300
On 04/07/2010 05:45 PM, Mart Frauenlob wrote:
#!/bin/sh
grep -w "fred" file || printf "%s\n" "fred">>file
Why not simply use
echo "fred" >> file
for the second command?
--
All men have the right to wait in line.
Eduardo M KALINOWSKI
eduardo@xxxxxxxxxxxxxxxxx
--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/4BBCFF82.4070904@xxxxxxxxxxxxxxxxx
- Follow-Ups:
- Re: OT: Script to add line to file if it doesn't exist
- From: Mart Frauenlob
- Re: OT: Script to add line to file if it doesn't exist
- References:
- OT: Script to add line to file if it doesn't exist
- From: Kent West
- Re: OT: Script to add line to file if it doesn't exist
- From: Mart Frauenlob
- OT: Script to add line to file if it doesn't exist
- Prev by Date: Re: automate updates in Lenny
- Next by Date: RE: [Samba] how to mount shares as a user without mount.cifs setuid
- Previous by thread: Re: OT: Script to add line to file if it doesn't exist
- Next by thread: Re: OT: Script to add line to file if it doesn't exist
- Index(es):
Relevant Pages
|