About standard input

We talked about standard output, but what is standard input?

Not all programs do this, but if you are a Linux command line user, or if you use the Windows command shell, you may have run into the following.

Let’s say you type the command "dir" in a Windows command shell. If you have a lot of files the results are going to stream by quickly, and you’ll need to use the scroll bar to view the results. And maybe even that won't be enough.

Or, you could type this command instead:

dir | more

The "more" program comes with Windows and it lets you page files. You can also use it this way:

more filename

Where "filename" is the name or path of a file you want to look at. So, more will use standard input as well as a command line.

You could run into programs which must have standard input in order to function correctly. The RPM filter action supports this.

Note that we have simply selected the option to use standard input, which is labeled "Transfer file to filter using standard input". As soon as I select that setting, the variables and template mask are disabled.

The reason for this is that if you are passing your print job to your program as standard input, you are not passing it as a file. Therefore, the filename template does not apply. It won’t matter to the program, because the program will receive the file contents through standard input.

Important note: you should remove %s from your Arguments if using standard input.