BATCH Examples


Example 1:

 

CMDLINE

INIT

"mv file.a file.b"

  

BATCH

CMDLINE

 

The command "mv file.a file.b" executes as a background task. Since neither {in} nor {out} were specified, stdin is closed and stdout is unchanged. If the "mv" command line generates error output to stderr, it appears in the PL/B program's stderr.

 

Example 2:

 

  

BATCH

"cp file.c file.d 2>cp.err"

 

The command "cp file.c file.d 2>cp.err" executes as a background task. Since neither {in} nor {out} were specified, stdin is closed and stdout is unchanged. If the "cp" command line generates error output to stderr (file descriptor 2), it is routed to the file "cp.err" by the "2>cp.err" Shell command.

 

Example 3:

 

  

BATCH

"rm *.*","/dev/null","rm.log"

  

(or)

 

  

BATCH

"rm *.* </dev/null >>rm.log"

 

The command "rm *.*" executes as a background task. Any stdin comes from "/dev/null" while stdout is appended to the file "rm.log". If the "rm" command line generates error output to stderr, it appears in the PL/B program's stderr.

 

Example 4:

 

  

BATCH

"rm *.* 2>&1",SRC,DEST

 

The command "rm *.*" executes as a background task using SRC and DEST to specify redirection. If SRC is null, stdin is closed. If DEST is null, stdout is unchanged. If the "rm" command line generates error output to stderr (file descriptor 2), it is routed to stdout (file descriptor 1) by the "2>&1" Shell command.

 



PL/B Language Reference ARCTAN Example BEEP Example