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