Re: for loop and sed

Página Principal
Anexos:
Mensagem como email
+ (text/plain)
Apagar esta mensagem
Responder a esta mensagem
Autor: Nathan England
Data:  
Para: der.hans, Main PLUG discussion list
Assunto: Re: for loop and sed

> > for user in '/bin/ls /home'; do
>
> are those backticks?
>
> > cp /var/spool/cron/nengland /var/spool/cron/$user
> > sed -i 's/nengland/$user/' $user
>
> sed -i 's/nengland/'$user'/' $user
>
> Single quotes inhibit variable expansion, so you need to get outside the
> quotes :).
>
> Just thought I'd point it out because you can't always used double-quote
> as Kurt suggested.



Yes, they are backticks. I used double quotes and it worked great. Thanks
guys!
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss