[SunHELP] find in file script..

Rob Fielding rob at dsvr.net
Wed Jun 11 10:14:31 CDT 2003


Adrian.Florea at alcatel.ro wrote:
> try this:
> 
> --- begin ----
> 
> #!/bin/sh
> PRINTERNAME=`awk '{if ($1 ~ /printer_ip/) { print $2; exit}}' /etc/hosts`
> if sed -e "/$PRINTERNAME/d" /etc/hosts >/etc/hosts.new; then
> 	cp /etc/hosts.new /etc/hosts
> fi
> lpadmin -x $PRINTERNAME

youuuu ubergeek

;)



-- 

Rob Fielding
Development 	Designer Servers Ltd 	www.dsvr.co.uk



More information about the SunHELP mailing list