sys.unixShellCommand

Syntax sys.unixShellCommand (s)

Params s, a string, is the command you want to execute on the command line.

Action Executes a string as if typed on the command line.

Returns A string, the result.

Examples sys.unixShellCommand ("whoami")

   » "brent\n"

sys.unixShellCommand ("cd /etc;pwd") //you can chain commands with a semi-colon

   » "/etc\n"

sys.unixShellCommand ("~/testPerlScript") //run a Perl script

   » "Hello, world!\n"

sys.unixShellCommand ("cd /etc;ls -al | grep inetd") //pipes may be used

   » "-rw-r--r-- 1 root wheel 2544 Sep 1 2000 inetd.conf\n"

sys.unixShellCommand ("less /etc/inetd.conf") //an odd alternative to file.readWholeFile

   » "#n# Internet server configuration databasen#n#t@(#)inetd.conft5.4 (Berkeley) 6/30/90n#n#...

Notes This verb is new in Frontier 7.0, and is implemented only in the Mac OS X version.

This verb calls popen to execute the command and get the result, and is similar to commands in other scripting languages such as Python's os.popen.

See Also Calling the Shell from Frontier

Discuss