Author Topic: command output redirection as input  (Read 3153 times)

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1323
  • Karma: +26/-0
    • View Profile
command output redirection as input
« on: February 16, 2020, 07:56:57 pm »
This is an attempt on my part to convert a Unix RPM package dependencies command to OS/2 CLI command.

I have the following Unix command: yum deplist $(rpm -q libaio)

...tried the following:
Code: [Select]
[G:\](rpm -q libaio) 2>&1 |(yum deplist)
Loaded plugins: changelog, downloadonly, ps, replace, verify
Error: Need to pass a list of pkgs to deplist
 Mini usage:

deplist PACKAGE...

List a package's dependencies

...clearly this does not work, and I'm literally clue-less on the subjet of OS/2 command output/input re-direct.

Found the following two pages which seemed to make sense:

But none of these have yielded any where am I going wrong with this?

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: command output redirection as input
« Reply #1 on: February 16, 2020, 08:05:43 pm »
You need to use UNIX shell for such commands. OS/2 shells like 4os2 cannot substitute result of one command into another.
Just start ash/dash and type the command as is. If

yum deplist $(rpm -q libaio)

does not work, you can try

yum deplist `rpm -q libaio`

Or, you can use a REXX script, like this:

'rpm -q libaio | rxqueue'
parse pull x
'yum deplist ' || x

PS: did you tried like this:

rpm -q libaio | yum deplist -

« Last Edit: February 16, 2020, 08:09:10 pm by Valery Sedletski »