spec

Software for Diffraction

3.3.1. - UNIX Commands



These simple macros are for commonly used UNIX commands.
def cd    'chdir("$*")'          # Change working directory
def pwd   'print CWD'            # Print working directory
def u     'unix("$*")'           # Execute arbitrary shell commands
def ls    'unix("ls $*")'        # List files
def l     'unix("ls -l $*")'     # Long listing of files
def cat   'unix("cat $*")'       # Show file contents
def less  'unix("less $*")'      # Peruse files with handy utility
def mail  'unix(sprintf("%s $*", MAIL))' # Send mail
def ed    'unix("ed $*")'        # Invoke an editor
def ned   'unix("ned $*")'       # Invoke another editor
def vi    'unix("vi $*")'        # Invoke another editor
The u macro, without arguments, spawns an interactive subshell, using your SHELL environment variable.

Note how the above macros supply parentheses and quotation marks around the arguments, as required by the parser's grammar rules.