• 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
Q: echo | sed ; can't replace range of lines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Q: echo | sed ; can't replace range of lines


  • Subject: Q: echo | sed ; can't replace range of lines
  • From: Gnarlodious <email@hidden>
  • Date: Mon, 17 May 2004 16:38:02 -0600

Why does the first command work but the 2nd doesn't?

set someLines to "1
2
3
4
5
6"

set replaceLine to do shell script "echo " & someLines & " | sed 's/2/8/'"

set deleteRange to do shell script "echo " & someLines & " | sed '/2/,/5/d'"


It operates on a text file just fine:

do shell script "sed -e '/2/,/5/d' testFile"

-- > 1
-- > 6


Am I doing something wrong?

-- Gnarlie
_______________________________________________
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.


  • Follow-Ups:
    • Re: Q: echo | sed ; can't replace range of lines
      • From: Graff <email@hidden>
  • Prev by Date: Re: adding authentication...
  • Next by Date: Re: adding authentication...
  • Previous by thread: Re: adding authentication...
  • Next by thread: Re: Q: echo | sed ; can't replace range of lines
  • Index(es):
    • Date
    • Thread