Re: do shell script, curl and cookies
Re: do shell script, curl and cookies
- Subject: Re: do shell script, curl and cookies
- From: Håvard Graudo <email@hidden>
- Date: Wed, 17 Apr 2013 11:32:24 +0200
Den 17. apr. 2013 kl. 04.12 skrev Doug McNutt:
> 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.
You are right;
mkdir project
cd project
curl --cookie-jar zecookie.txt 'http://...
--> writes cooke OK
-- Quit Terminal and start it again:
curl --cookie zecookie.txt <http://
--> ERROR
cd project
curl --cookie zecookie.txt <http://
--> reads cookie OK!
do shell script seems to randomize this path on every call, so giving the complete path for the cookie seems to be the way to go with 'do shell script'
håvard
_______________________________________________
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