Re: Command line text substitution
Re: Command line text substitution
- Subject: Re: Command line text substitution
- From: Axel Luttgens <email@hidden>
- Date: Sat, 11 Jan 2003 14:43:18 +0100
Paul Skinner wrote:
Ok, I'm trying to use the right tools. What's the right CL tool for
replacing a string within a string? perl is an obvious choice. So, how
would I replace a given string in another string using do shell script?
You could have a look at the 'sed' utility.
For example, replacing 'def' by 'xyzt' in 'abcdef':
% echo 'abcdefg' | sed 's/def/xyzt/'
abcxyztg
Another utility, 'tr', may also prove useful.
Of course, the usual cautions about special characters apply.
HTH,
Axel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.