Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: misc.escapespecial - Function Up: misc - Tool Previous: misc.type - Function


misc.shellcmd - Function



Package utility
Module misc
Tool misc


Execute a shell command


Synopsis
shellcmd(command, log)


Description
Execute a shell command, logging results optionally. The Glish function shell() can also be used directly but it does not split lines or log. This function does not use the gmisc client, just the Glish shell client.



Arguments

command   Command string
    Allowed: String
log   Log the output?
    Allowed: Bool
    Default: T


Example
- dms.shellcmd('ls -l', log=F)
total 54
lrwxrwxrwx   1 root     bin            31 Jul 29 16:45 RCS -> /aips++/daily/rcs/trial/apps/ms
drwxr-xr-x   2 tcornwel staff         512 Aug 29 15:11 aips++.log.table
-r--r--r--   1 tcornwel staff         256 Aug  1 21:31 makefile
-rw-r--r--   1 tcornwel staff        1556 Aug 29 09:28 ms.cc
-r--r--r--   1 tcornwel staff        7275 Aug 29 09:29 ms.g
-rw-r--r--   1 tcornwel staff        8889 Aug 29 09:28 ms.help
-rw-r--r--   1 tcornwel staff       22235 Aug 29 09:28 msImpl.cc
-rw-r--r--   1 tcornwel staff        4200 Aug 29 09:28 msImpl.h
-rw-r--r--   1 tcornwel staff         269 Aug  1 21:41 templates
drwxrwsr-x   2 tcornwel staff         512 Aug  1 21:41 tmplinst
T 
- shell('ls -l')
total 54 lrwxrwxrwx   1 root     bin            31 Jul 29 16:45 RCS -> /aips++/daily/rcs/trial/apps/ms drwxr-xr-x   2 tcornwel staff         512 Aug 29 15:11 aips++.log.table -r--r--r--   1 tcornwel staff         256 Aug  1 21:31 makefile -rw-r--r--   1 t

cornwel staff        1556 Aug 29 09:28 ms.cc -r--r--r--   1 tcornwel staff        7275 Aug 29 09:29 ms.g -rw-r--r--   1 tcornwel staff        8889 Aug 29 09:28 ms.help -rw-r--r--   1 tcornwel staff       22235 Aug 29 09:28 msImpl.cc -rw-r--r--   1 tcornwe

l staff        4200 Aug 29 09:28 msImpl.h -rw-r--r--   1 tcornwel staff        3059 Jun 12 15:07 tMS.cc~ -rw-r--r--   1 tcornwel staff         269 Aug  1 21:41 templates drwxrwsr-x   2 tcornwel staff         512 Aug  1 21:41 tmplinst



Returns
Bool




next up previous contents index
Next: misc.escapespecial - Function Up: misc - Tool Previous: misc.type - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15