info("posixtasks")
The info(“posixtasks”) function list of POSIX shell tasks running in the background.
Description
This function returns a list of POSIX shell tasks running in the background. The list is a carriage return separated list of the task identifiers. See posixtask and posixtask( to learn how background shell tasks are used.
Keep in mind that this list is only accurate at the instant this function is used. You cannot rely on this list even milliseconds later, as the list can change at any time (for example when a background task finishes running). For example, you might be tempted to use this function to check if a background task is running before you kill it.
if arraycontains(info("posixtask"),"My Task",cr())
stopposixtask "My Task"
endif
However, this won’t work reliably. It’s possible that the task may finish in the time between the if and stopposixtask statements, and then an error will occur. Instead of the code above, you should trap the error like this:
stopposixtask "My Task"
if error
nop
endif
See Also
- applescript -- executes an AppleScript.
- applescript( -- executes AppleScript source code and returns the result.
- blindposixscript( -- executes a POSIX shell script using NSTask and returns the process id.
- executeapplescript -- compiles and runs an AppleScript.
- executeperlscript -- executes Perl code.
- executesudounix -- executes a UNIX shell command using *sudo* (root) privileges.
- executeunix -- executes a UNIX shell command.
- perl -- executes a Perl script (program).
- perl( -- executes a perl program and returns the result (stdout).
- php -- executes a PHP script (program).
- php( -- executes a PHP program and returns the result.
- posixscript( -- executes a POSIX shell script using NSTask and returns the result.
- posixtask -- executes a POSIX shell script in the background using NSTask.
- posixtask( -- executes a POSIX shell script in the background using NSTask.
- python -- executes a Python script (program).
- python( -- executes a python program and returns the result (stdout).
- ruby -- executes a Ruby script (program).
- ruby( -- executes a ruby program and returns the result (stdout).
- scriptbglog -- specifies a path/file for output from STDOUT from embedded programs run in the background (Perl, Ruby, Python, PHP).
- Scripting Language Configuration -- configuring the scripting languages available to Panorama (Perl, PHP, Python and Ruby).
- scripttimeout -- sets the maximum runtime allowed for an embedded program (AppleScript, ShellScript, Perl, Ruby or Python).
- shellscript -- executes a UNIX shell script.
- shellscript( -- executes a UNIX shell script and returns the result.
- stopposixtask -- stops a POSIX shell script that is running in the background.
- usebashprofile -- grabs the search path from the `.Bash_profile` file in the user's home folder, so that these paths will be used by scripting languages (*Ruby, Python*, etc.).
- xcallbackurl -- performs an action in another application using the x-callback-url mechanism.
History
10.2 | New | New in this version. |