From rpm's man page:
--pipe CMD
Pipes the output of rpm to the command CMD.
Why was this added? Why would you use it instead piping via the shell itself?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityFrom rpm's man page:
--pipe CMD
Pipes the output of rpm to the command CMD.
Why was this added? Why would you use it instead piping via the shell itself?
That option would not be useful when rpm
is called from a shell.
But when called from some other program it would simplify passing non-static arguments to rpm
if those arguments are constructed from some form of user input (provided the calling program is written in a language that does not forcefully call a shell to execute other programs anyway):
rpm
and CMD
separately.sh -c ´rpm Argument1 Argument2 ...´ | CMD
, it needs an additional level of quoting around arguments to prevent them from being split into words or interpreted by the shell if those arguments could contain spaces or shell metacharacters:rpm
is user input to the calling program, it could possibly be Tom and Alice´s dog
and the programmer would have to translate that to Tom\ and\ Alice\´s\ dog
when building the argument list for the shell. (And any arguments to CMD
would have to be quoted the same way.)--pipe
option, the calling program needs none of these.CMD
would have to be quoted like before because CMD is interpreted by a shell which is called from rpm
because CMD
is a single word from a single argument to rpm
.)