• 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: Passing ampersands through a shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing ampersands through a shell script


  • Subject: Re: Passing ampersands through a shell script
  • From: "Mark J. Reed" <email@hidden>
  • Date: Sun, 25 Oct 2009 14:32:00 -0400

An ampersand terminates the comand and starts a new one which runs in
parallel. Run three copies of ls all fighting over the same terminal
to show their output:

  ls & ls & ls

But in this case the problem is that ampersand is also special in URL
query strings.  If you send

http://post/my/info?artist=Captain&Tennille

then the variable assignments are "artist=Captain" and "Tennille=",
rather than the intended "artist=Captain&Tennille".  Backslash or
quotation marks will get the ampersand through the shell, but don't
help with the query string problem.  You need both a quoting mechanism
for the shell, and to tell whatever command you're using to escape the
query string values, so it sends

http://post/my/info?artist=Captain&Tennille

instead.

--
Mark J. Reed <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Passing ampersands through a shell script (From: hd <email@hidden>)
 >Re: Passing ampersands through a shell script (From: LuKreme <email@hidden>)
 >Re: Passing ampersands through a shell script (From: hd <email@hidden>)
 >Re: Passing ampersands through a shell script (From: LuKreme <email@hidden>)
 >Re: Passing ampersands through a shell script (From: Bruce Brown <email@hidden>)

  • Prev by Date: Re: Passing ampersands through a shell script
  • Next by Date: Re: Wrong day name in Date format
  • Previous by thread: Re: Passing ampersands through a shell script
  • Next by thread: Re: Passing ampersands through a shell script
  • Index(es):
    • Date
    • Thread