• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Command line text substitution
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Command line text substitution (From: Paul Skinner <email@hidden>)

  • Prev by Date: Re: Script to get default browser? > Philip
  • Next by Date: Re: Getting .Mac info
  • Previous by thread: Command line text substitution
  • Next by thread: Re: Command line text substitution
  • Index(es):
    • Date
    • Thread