ls ;BMI/BI %ZOSF COMMANDS. ;06/25/2013
;;8.0;KERNEL;****;Jun 25, 2013
Quit
;
sc(DIR,RESULT)
New TMP,I,CMD Kill RESULT
Set TMP="dirTMP",CMD="ls --format=single-column "_DIR
Open TMP:(shell="/bin/sh":command=CMD)::"PIPE"
Use TMP For RESULT(0)=1:1 Read RESULT(RESULT(0))#4000:1 Quit:$ZEOF
If RESULT(RESULT(0))="" Kill RESULT(RESULT(0)) Set RESULT(0)=RESULT(0)-1
For I=1:1:RESULT(0) Set RESULT(I)=$Translate(RESULT(I),$c(13),"")
Close TMP
Quit
;
al(DIR,RESULT)
New TMP,I,CMD Kill RESULT
Set TMP="dirTMP",CMD="ls -al "_DIR
Open TMP:(shell="/bin/sh":command=CMD)::"PIPE"
Use TMP For RESULT(0)=1:1 Read RESULT(RESULT(0))#4000:1 Quit:$ZEOF
If RESULT(RESULT(0))="" Kill RESULT(RESULT(0)) Set RESULT(0)=RESULT(0)-1
For I=1:1:RESULT(0) Set RESULT(I)=$Translate(RESULT(I),$c(13),"")
Close TMP
Quit
;
pwd()
New TMP,I,CMD Kill RESULT
Set TMP="dirTMP",CMD="pwd"
Open TMP:(shell="/bin/sh":command=CMD)::"PIPE"
Use TMP For RESULT(0)=1:1 Read RESULT(RESULT(0))#4000:1 Quit:$ZEOF
If RESULT(RESULT(0))="" Kill RESULT(RESULT(0)) Set RESULT(0)=RESULT(0)-1
For I=1:1:RESULT(0) Set RESULT(I)=$Translate(RESULT(I),$c(13),"")
Close TMP
Quit RESULT(1)
;
cat(FILE,RESULT)
New TMP,I,CMD Kill RESULT
Set TMP="dirTMP",CMD="cat "_FILE
Open TMP:(shell="/bin/sh":command=CMD)::"PIPE"
Use TMP For RESULT(0)=1:1 Read RESULT(RESULT(0))#4000:1 Quit:$ZEOF
If RESULT(RESULT(0))="" Kill RESULT(RESULT(0)) Set RESULT(0)=RESULT(0)-1
For I=1:1:RESULT(0) Set RESULT(I)=$Translate(RESULT(I),$c(13),"")
Close TMP
Quit
;
lsgrep(DIR,GREP,RESULT)
New TMP,I,CMD Kill RESULT
Set TMP="dirTMP",CMD="ls --format=single-column "_DIR_" | grep "_GREP
Open TMP:(shell="/bin/sh":command=CMD)::"PIPE"
Use TMP For RESULT(0)=1:1 Read RESULT(RESULT(0))#4000:1 Quit:$ZEOF
If RESULT(RESULT(0))="" Kill RESULT(RESULT(0)) Set RESULT(0)=RESULT(0)-1
For I=1:1:RESULT(0) Set RESULT(I)=$Translate(RESULT(I),$c(13),"")
Close TMP
Quit