Hi Thanks very much :o) Andrew -----Original Message----- From: Stefan Troeger [mailto:stefan@troeger.st] Sent: 08 April 2001 17:45 To: SuSE Linux Mailing List Subject: Re: [SLE] Bash scripting - pattern matching Try this one: -------------------------------------------> #!/bin/sh FILE='/tmp/names' if test "$#" -lt 1; then echo "I need at least one parameter" >&2 exit 1 fi for name; do if grep -qi "$name" "$FILE"; then echo "$name is already in $FILE" else echo "Adding $name to $FILE" echo "$name" >>"$FILE" fi done <------------------------------------------- Ciao, Stefan -- Stefan Troeger o _ _ _ stefan@troeger.st __o __o /\_ _ \\o (_)\__/o (_) _`\<, _`\<, _>(_) (_)/<_ \_| \ _|/' \/ (_)/(_) (_)/(_) (_) (_) (_) (_)' _\o_ -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq