On Mon, 2005-04-25 at 14:30 +0300, mihai wrote:
> On Mon, 25 Apr 2005 14:03:41 +0300
> Bogdan Rotariu <[EMAIL PROTECTED]> wrote:
> 
> > Salut,
> > 
> > Cum as putea face in bash o chestie de genul asta :
> > 
> > #Popescu Ionescu
> > 1.2.3.4
> > Vreau sa fac un script sa puna # in fata la 1.2.3.4, si chiar sa
> > scoata  # din fata.
> > 
> 
> [EMAIL PROTECTED]:~$ cat popa 
> #popa
> 1.2.3.4
> [EMAIL PROTECTED]:~$ 
> 
> 
> sed 's/1.2.3.4/#1.2.3.4/' popa
> #popa
> #1.2.3.4
> 
Un pic mai elegant:

======
#!/bin/sh

IP=$1
FILE=$2

IP=`echo $IP | sed 's/\./\\./g' `

sed -e "/$IP/s/^/\#/" -i $FILE
======

-- 
Kramer



-- 
This message was scanned for spam and viruses by BitDefender.
For more information please visit http://linux.bitdefender.com/


--- 
Detalii despre listele noastre de mail: http://www.lug.ro/


Raspunde prin e-mail lui