[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] sed
- Subject: [ale] sed
- From: timothy at meanor.net (timothy at meanor.net)
- Date: Fri, 18 May 2007 09:12:10 -0400
Here's another perl solution:
perl -p -i.bak -e "s/abc/xyz/g" file
where "file" is the file you want to change.
This edits the file inline and saves the previous version to file.bak.
-Tim
>>Hi,
>>
>>I want to take a text file and replace each occurrence of abc with
>>xyz. I know that this can be done with an editor like nano; however,
>>I want to do this within a Perl script. I think sed can be used to
>>do this and I have known about it since my UNIX days, but have never
>>used it. Can anyone tell me what the syntax would be?
>>
>>Thanks,
>>
>>Terry Bailey
>>
>>_______________________________________________
>>Ale mailing list
>>Ale at ale.org
>>http://www.ale.org/mailman/listinfo/ale
- Follow-Ups:
- [ale] sed
- From: marvin.higginbottom at gmail.com (Marvin, International Martian of Mystery)