• 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: Include "\" in do shell script command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Include "\" in do shell script command


  • Subject: Re: Include "\" in do shell script command
  • From: "Johnny AppleScript" <email@hidden>
  • Date: Fri, 18 Jul 2003 14:01:51 -0600

Are you *sure* your id is good?

set theID to "tkw4u"
set a to do shell script "whois -h whois.virginia.edu \\" & "!" & theID
log a
set b to do shell script "whois -h whois.virginia.edu \\!" & theID
log b
set c to do shell script "whois -h whois.virginia.edu " & (ASCII character
92) & "!" & theID
log c
set backslash to ASCII character 92
set d to do shell script "whois -h whois.virginia.edu " & backslash & "!" &
theID
log d
set backBang to (ASCII character 92) & "!"
set e to do shell script "whois -h whois.virginia.edu " & backBang & theID
log e
set whois to "whois -h whois.virginia.edu "
set f to do shell script whois & backBang & theID
log f
set theID to backBang & theID
set g to do shell script whois & theID
log g

All of the above for me returns:
(* Name: [edit for spam]
Mailid/Handle: tkw4u
Unix Uid: 47521
Classification: Staff
Department: It-Acad Comp-Hs
Office Phone: [edit for spam]
Fax Phone: [edit for spam]
Registered E-Mail Addr: email@hidden
[edit for spam]@t1.mail.virginia.edu*)


On 03/07/18 12:19 PM, "Timothy K. Wilkinson" <email@hidden> wrote:

> The problem is that using that syntax works just fine if you actually put
> the id in there. It compiles and runs just fine as you so nicely
> demonstrated. Now try it the way I actually posted it:
>
>
> do shell script "whois -h whois.virginia.edu " & (ASCII character 92) & "!"
> & the_id
>
> Or like this:
>
> Do shell script "whois -h whois.virginia.edu \\!" & the_id
>
>
> Both return the same error telling me the record can't be found, yet I know
> the record exists. If I look in the event log it shows the command being
> issued in exactly the same way as when I actually enter an ID into the
> string. It seems as if the variable is the weak link here. I tried running
> the above and declaring the contents of the variable earlier in the script
> and got the same error.
>
>
> Any other ideas?
_______________________________________________
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: 
 >Re: Include "\" in do shell script command (From: "Timothy K. Wilkinson" <email@hidden>)

  • Prev by Date: Re: applescript-users digest, Vol 3 #1844 - 17 msgs
  • Next by Date: Re: Include "\" in do shell script command
  • Previous by thread: Re: Include "\" in do shell script command
  • Next by thread: Re: Include "\" in do shell script command
  • Index(es):
    • Date
    • Thread