OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Setup & Installation => Topic started by: Dariusz Piatkowski on February 16, 2020, 07:56:57 pm

Title: command output redirection as input
Post by: Dariusz Piatkowski 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:
1) https://www.tavi.co.uk/os2pages/cmd.html (https://www.tavi.co.uk/os2pages/cmd.html)
2) https://www.robvanderwoude.com/redirection.php (https://www.robvanderwoude.com/redirection.php)

But none of these have yielded any results...so where am I going wrong with this?
Title: Re: command output redirection as input
Post by: Valery Sedletski 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 -

?