shell

Format:
shell( [text_expr command[, int_expr size]])
Result:
Text
Description:
A command is executed in a shell and the output is written into a buffer. The first line of the buffer is returned by this function, leaving the buffer output pointer at the beginning of the buffer. The user may specify the size of the buffer in bytes, the default value is 10kB.

The shell() functions displays an error message, if the buffer is not sufficiently large. Use gra_status() to test the completion status of shell().

If the shell function is called without arguments, the buffer is read and the buffer output pointer is moved behind the last record that has been read.

show/buffer displays what is left in the buffer.

show/buffer/reset resets the output pointer to the beginning of the buffer.

Example 1:
SPECTRA> * = shell( pwd)
/home/myname
Example 2:
!
! put the list of all .fio files of
! the current directory into the buffer
!
s1 = shell(ls -1 *.fio)
if !gra_status()
  say " Error: Too many files, increase buffer size."
  wait
  end
endif

loop:
!
! read the files names
!
fname = shell()
!
! test whether we are done
!
if !search_symbol( fname)
  end
endif
...
goto loop