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

Re: Shell Script



voce pode usar:

-------------------------------------------------------------
mv /etc/webmin/miniserv.conf /etc/webmin/miniserv.conf.tmp 

cat /etc/webmin/miniserv.conf.tmp  \
| sed 's/^allow=.*$//g' > /etc/webmin/miniserv.conf
rm -f /etc/webmin/miniserv.conf.tmp

-------------------------------------------------------------

ou

mv /etc/webmin/miniserv.conf /etc/webmin/miniserv.conf.tmp 
grep -v "allow" /etc/webmin/miniserv.conf.tmp
> /etc/webmin/miniserv.conf
rm -f /etc/webmin/miniserv.conf.tmp




igor





Em Qui, 2005-08-25 às 13:59 -0300, Keny Hayakawa Schmeling escreveu: 
> Boa tarde pessoal
> 
> Não conheço nada de Shell Script, só o basicão mesmo.
> 
> Bom, estou escrevendo um Shell, que vai de forma automática, fazer o
> download dos pacotes e instala-los via apt-get. São pacotes como o Samba2,
> Webmin, Bind9, etc, etc, etc....
> 
> Minha dúvida é o seguinte, eu gostaria que o shell script editasse um
> arquivo e alterasse uma linha, por exemplo, queria que ele pegasse o arquivo
> /etc/webmin/miniserv.conf e apagasse ou editasse a linha que está escrito
> allow=127.0.0.1
> 
> Existe alguma forma de fazer isso?
> 
> Vlw
> 




Reply to: