Re: for loop and sed

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Nathan England
Date:  
To: der.hans, Main PLUG discussion list
Subject: 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