; SYSTEM
;---------------------------------------------------------------
;! Verb to send a command to the operating system
;# VERB GENERAL
;-----------------------------------------------------------------------
;;  Copyright (C) 2004-2005
;;  Associated Universities, Inc. Washington DC, USA.
;;
;;  This program is free software; you can redistribute it and/or
;;  modify it under the terms of the GNU General Public License as
;;  published by the Free Software Foundation; either version 2 of
;;  the License, or (at your option) any later version.
;;
;;  This program is distributed in the hope that it will be useful,
;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;  GNU General Public License for more details.
;;
;;  You should have received a copy of the GNU General Public
;;  License along with this program; if not, write to the Free
;;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
;;  MA 02139, USA.
;;
;;  Correspondence concerning AIPS should be addressed as follows:
;;         Internet email: aipsmail@nrao.edu.
;;         Postal address: AIPS Project Office
;;                         National Radio Astronomy Observatory
;;                         520 Edgemont Road
;;                         Charlottesville, VA 22903-2475 USA
;-----------------------------------------------------------------------
SYSTEM    LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
SYSTEM:  Verb to send a command to the operating system
SYSCOM                             Command to send
SYS2COM                            Additional parts of command
SYSOUT                             Where output goes
ERROR    @                         Error occurred
----------------------------------------------------------------
SYSTEM
Type: Verb
Use:  SYSTEM sends a command to the operating system.  The command and
      the output "device" are character strings up to 72 characters
      in length.  They may contain lower case letters - remember to
      type them in as the last command in the input line and to omit
      the close quote (').  The POPS error code is not set; the ERROR
      adverb is set instead so that a procedure may test this.
      The command the system sees is
            SYSCOM  !! SYS2COM >> SYSOUT
      so it is not needed to direct an output in SYSCOM unless one
      wants to overwrite rather than append.  Each of the 8 strings in
      the string array SYS2COM are appended to SYSCOM.  All trailing
      blanks are removed.  If you want a blank between portions of the
      command you must put it as a leading blank in the SYS2COM(i).
      Thus
            SYSCOM = 'cat
            SYS2 = ' '
            SYS2(1) = ' AAA.FOR     '
            SYS2(2) = ' fff.txt
            SYS2(7) = ' Zzz'
            SYS2(8) = '.c
            SYSOUT = '$HOME/fils.cat
      becomes
         'cat AAA.FOR fff.txt Zzz.c >> $Home/fils.cat'
      and is sent to the operating system.

      Note that, if SYSCOM !! SYS2COM contains the string ' >', then
      the ' >> ' !! SYSOUT is omitted.

      It appears that aliases are not known - at least in bash shells
      - but environment variables are known.  The command may require
      you to enter response(s) since control is not returned to AIPS
      until the command is finished.  You can even run another aips
      with this command!
Adverbs:
  SYSCOM.....The desired system command - no default.
  SYS2COM....Eight more 64-character strings appended to SYSCOM with a
             blank separator.  Trailing blanks are ignored.
  SYSOUT.....Output device for the command: default is /dev/tty which
             is your terminal window.
  ERROR......Output adverb: > 0 => error occurred, -1 => no error.
----------------------------------------------------------------
