Re: Help with Error in do shell script
Re: Help with Error in do shell script
- Subject: Re: Help with Error in do shell script
- From: Christopher Nebel <email@hidden>
- Date: Sun, 13 Apr 2003 18:14:42 -0700
On Sunday, April 13, 2003, at 01:20 PM, Emmanuel wrote:
At 8:38 PM +0200 13/04/03, julifos wrote:
Here is my error (type 1)...
set myPID to word 1 of (do shell script "ps x | grep -i '" & POSIX
path of
(path to me) & "'")
This works OK from an applet, but it will throw an error in both a
script
editor or ASStudio app.
Some quick workarround?
Try from a script editor with a shorter name :-)
What Emmanuel is hinting at is that "ps -x" doesn't print out the
entire process name, but only the first 60 characters or so.
Therefore, depending on how long the path to the executable is, it
might or might not appear. Try "ps -xww" instead, which removes the
length limit. (One wonders what you're going to do with your own
process id, however.)
Remember, folks, errors from "do shell script" mean that your shell
command returned an error, and you can find out what it means by
reading the Diagnostics section of the appropriate man page. In this
case, "man grep" would have told you that 1 means that no matches were
found.
--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.