Re: Running VPN client...
Re: Running VPN client...
- Subject: Re: Running VPN client...
- From: Christopher Nebel <email@hidden>
- Date: Sun, 13 Jul 2003 18:44:04 -0700
On Sunday, July 13, 2003, at 3:26 AM, Emmanuel wrote:
At 6:59 PM -0700 12/07/03, Christopher Nebel wrote:
On Friday, July 11, 2003, at 10:06 AM, Emmanuel wrote:
I think that if you append " &" to the command, "do shell script"
will return immediately.
No, it won't. You need some additional magic thanks to the wonders
of Unix pipes. Read
<http://developer.apple.com/technotes/tn2002/tn2065.html> for the
full solution.
I think you mean specifically:
<http://developer.apple.com/technotes/tn2002/tn2065.html#Section5>
Right. (I should put a special link on that question so I can refer to
it...)
Thanks much for the correction. Appending " &" as I said is not a good
idea, *don't do it*.
Well, it's not harmful, it just doesn't do anything useful.
So, am I not correct here:
I think that if you append " > file_path &" to the command, "do shell
script" will return immediately.
Sorry, still wrong. "do shell script" watches both stdout and stderr,
so you need to redirect both by appending " > file_path 2>&1 &" to the
command.
Closely related to that topic, I would suggest a short additional Q&A
in Section 5 (I would say, as the 5th Q&A) such as:
--------------------------------
Q: I've started a background process: how can my script test whether
the process is complete?
A: Use "ps" to get the list of the processes:
set still_running to (my_command is in do shell script "ps -xw")
--------------------------------
Good suggestion.
--Chris Nebel
Apple Development Tools
_______________________________________________
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.