AnsweredAssumed Answered

Using ViewLogic.Exec to run commands using Pipe character

Question asked by beltz on Apr 5, 2020
Latest reply on Apr 6, 2020 by .-.--.--

Using ViewLogic.Exec, I'm having problems with running a command that is two commands, where I pass the output of one command to another using the Pipe character. It only runs the first command and ignores the second command.

 

For example (I realize I could do the following in one command, but I'm just using it as an example using the Pipe character)

 

cmd = "ls -dl asm* | grep asm_data"

ExecObj.Run cmd,1,1

 

it only runs the first command

ls -dl asm*

 

I also have a similar problem if I try to direct the output of a command to a file. It just executes the command without directing the output to the file.

 

cmd = "ls -dl asm* > /tmp/1"

ExecObj.Run cmd,1,1

 

Walt Beltz

Lexmark International Inc

Lexington, KY

Outcomes