[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] sed
- Subject: [ale] sed
- From: ozone at webgroup.org (David Tomaschik)
- Date: Fri, 18 May 2007 19:28:37 -0400
- In-reply-to: <[email protected]>
- References: <14886834.204241179493930531.JavaMail.servlet@perfora> <[email protected]>
Marvin, International Martian of Mystery wrote:
> timothy at meanor.net wrote:
>> Here's another perl solution:
>>
>> perl -p -i.bak -e "s/abc/xyz/g" file
>>
>> where "file" is the file you want to change.
>>
> What would be the syntax if "file" had spaces in it? Would you escape
> the spaces, or would you double-quote the variable?
>
>
> For sed and perl, preferably. :-)
At least for sed, the only place the file string would be
interpreted/globbed is by the shell. Thus, file\ with\ spaces and "file
with spaces" would be equivalent.
David
- References:
- [ale] sed
- From: timothy at meanor.net (timothy at meanor.net)
- [ale] sed
- From: marvin.higginbottom at gmail.com (Marvin, International Martian of Mystery)