• 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: do shell script, curl and cookies
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script, curl and cookies


  • Subject: Re: do shell script, curl and cookies
  • From: Doug McNutt <email@hidden>
  • Date: Tue, 16 Apr 2013 20:12:38 -0600

At 09:48 +0200 4/16/13, Håvard Graudo wrote:
>Den 13. apr. 2013 kl. 01.31 skrev Christopher Stone:
>
>>On Apr 11, 2013, at 17:55, Doug McNutt <<mailto:email@hidden>email@hidden> wrote:
>>
>>>>That looks right to me, but maybe you should flesh out a known path to your cookie, just to confirm it is writing something and it where and what you expect:
>>>>
>>>That's a good idea.
>>>
>>>Full pathnames are generally required in any Do Shell Script command and I'm not so sure about that ~ shortcut to your home directory.
>>>
>>______________________________________________________________________
>>
>>I believe curl remembers where it stores cookies within the same shell session.  But of course Applescript always initiates a new shell session every time do shell script is called.  Therefore you have to explicitly tell curl where to look when making a sequential calls.
>>
>
>
>
>curl finds the cookie (without the path) - even if I quit Terminal and start it again. (Mac OS 10.6.)
>
>Terminal:
>
>curl --cookie-jar zecookie.txt 'http://...
>--> write cookie OK
>-- Quit Terminal and start it again:
>curl --cookie zecookie.txt <http://.../>http://...
>--> read cookie OK

Just for fun, try it this way.

mkdir project
cd project
curl --cookie-jar zecookie.txt 'http://...

-- Quit Terminal and start it again:
curl --cookie zecookie.txt <http://.../>http://...

In Terminal.app there really is a current working directory and, unless you're changing it in your .profile or .tcshrc it will start at ~, your home directory.  In Do Shell Script it's not well defined and might be /, the root directory where you may not have write access.

--

       Fe++
    //      \
Fe++          Fe++
  |           ||
Fe++          Fe++
   \\        /
       Fe++
 _______________________________________________
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: do shell script, curl and cookies
      • From: Håvard Graudo <email@hidden>
References: 
 >Re: do shell script, curl and cookies (From: Jim Skibbie <email@hidden>)
 >Re: do shell script, curl and cookies (From: Doug McNutt <email@hidden>)
 >Re: do shell script, curl and cookies (From: Christopher Stone <email@hidden>)
 >Re: do shell script, curl and cookies (From: Håvard Graudo <email@hidden>)

  • Prev by Date: Re(2): PowerMail: Sending and CCing to Messrs Foo & Bar
  • Next by Date: Re: PowerMail: Sending and CCing to Messrs Foo & Bar
  • Previous by thread: Re: do shell script, curl and cookies
  • Next by thread: Re: do shell script, curl and cookies
  • Index(es):
    • Date
    • Thread