• 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: Wget response
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wget response


  • Subject: Re: Wget response
  • From: Axel Luttgens <email@hidden>
  • Date: Fri, 28 Sep 2007 23:05:37 +0200

On 28/09/07 18:50, Jay Louvion wrote:

[...]
In the case of a valid number here is what the Terminal returns:

[...]
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/xml]

[ <=> ] 61,934 387.59K/s

18:48:33 (385.42 KB/s) - `shopdesc?shop=54321' saved [61934]

If the number is invalid, it reads so:

[...]
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/xml]

[ <=> ] 0 --.--K/s

18:40:09 (0.00 B/s) - `shopdesc?shop=12345' saved [0/0]


The file created contains no data and has simply changed it¹s name from ³shopdesc?shop=12236² to ³shopdesc?shop=12236 2>&1² following your code suggestion.

Is there a syntax error do you think ?


Yes, seems to be the case, because of a slight misplacement.

Here is my code:

set JobNr to [NumberHere]
set TheURL to "http://www.lagalerie.com/lagalerie/shopdesc?shop="; & JobNr
--& " 2>&1"
set TheCommand to "/opt/darwinports/bin/wget --http-user=[UserNameHere]
--http-passwd=[PasswordHere] " & quoted form of TheURL
set the clipboard to TheCommand -- <-- so I can test the result in the
Terminal as well
do shell script TheCommand


Taking the essential parts of above script, removing the comments where needed, and replacing the various [something] with sample values, one has:

set JobNr to 12345
set TheURL to "http://www.lagalerie.com/lagalerie/shopdesc?shop="; & JobNr & " 2>&1"
set TheCommand to "/opt/darwinports/bin/wget --http-user=someuser http-passwd=hispassword " & quoted form of TheURL


With the above, variable TheCommand is thus set to:

/opt/darwinports/bin/wget --http-user=someuser http-passwd=hispassword 'http://www.lagalerie.com/lagalerie/shopdesc?shop=12345 2>&1'

This sure is a cause of failure; the "2>&1" piece is now considered as part of wget's last argument instead of being a redirection to be applied to the command as a whole.

Could you try with following instead (may be wrapped):

set JobNr to 12345
set TheURL to "http://www.lagalerie.com/lagalerie/shopdesc?shop="; & JobNr
set TheCommand to "/opt/darwinports/bin/wget --http-user=someuser http-passwd=hispassword " & quoted form of TheURL & " 2>&1"


of course after having replaced 12345 and the other insanities of my own by their correct values?
With the above, TheCommand should now be set to:


/opt/darwinports/bin/wget --http-user=someuser http-passwd=hispassword 'http://www.lagalerie.com/lagalerie/shopdesc?shop=12345' 2>&1

which makes more sense (note what I meant by "slight": the single quote now ends wget's last argument, instead of enclosing the redirection operator too).

Could you let us know what happens with such a change?
Axel
_______________________________________________
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
  • Follow-Ups:
    • Re: Wget response
      • From: Jay Louvion <email@hidden>
References: 
 >Re: Wget response (From: Jay Louvion <email@hidden>)

  • Prev by Date: Mail.app and check for new mail
  • Next by Date: Re: RAM and CPU hogging
  • Previous by thread: Re: Wget response
  • Next by thread: Re: Wget response
  • Index(es):
    • Date
    • Thread