.SYSTEM COMMAND: ls *.OMM
[Enter the system command you want executed. This may also
be a Unix shell command file.
Substitution of do-loop indices, symbolic and register variables
is allowed anywhere in the command line.]
NOTES
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-- Sample loop for converting series of gif images to JPEG format using Imagemagick:
DO I=1,5 ; Loop
SYS ; Use "Imagemagick" to convert images
convert img{***i}.gif img{***i}.jpg
ENDDO ; End loop
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-- Sample loop for renaming/renumbering series of SPIDER images:
[n]=33
DO I=1,4 ; Loop
SYS ; System call for renumbering
cp jnk{***[n]}.dat jnk444{***I}.dat
[n]=[n]+1 ; Increment output file number counter
ENDDO ; End loop
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-- Sample loop for consecutively renaming/renumbering series of SPIDER
-- images while skipping any missing image numbers:
[num]=0 ; Initialize output file number counter
DO [it]=1,4 ; Loop
IQ FI [exists] ; Use "IQ FI" to see if file exists
jnk{***[it]} ; Filename
IF([exists].LE.0)CYCLE ; Skip if file not found
[num]=[num]+1 ; Increment output file number counter
SYS ; System call for renaming/renumbering SPIDER images
cp jnk{***[it]}.dat jnk444{***[num]}.dat
ENDDO ; End loop
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-- Sample showing symbolic parameter substitution within a procedure:
[var]=55 ; Set register variable outside of procedure
; (binding time for parameter substitution is
; before procedure is executed!)
@testsys ; Invoke testsys SPIDER procedure
doc ; Value given to: FILENAME PREFIX solicited
; by testsys procedure
Contents of invoked procedure testsys:
FR
?ENTER FILENAME PREFIX?[pre]
SYS
rm [pre]{***[var]}.$DATEXT
Result of invoked procedure:
rm doc055.DAT
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx