[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Script to add line to file if it doesn't exist



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@kalinowski.com.br


Reply to: