Index
Give output data with pipe
There is a file named samplefile
Give data to grep
Output data be filtered with John using grep
In case of specify a file as 2nd argument
xargs
Backgrounds:
Monitored and detectioned log by ZABBIX will do edit using awk and cut.
and then I would like to the output will filter from any file using grep.
Output John with echo and then output will gave to xargs with pipe.
xargs put argument to right side of echo.
If give file as argument to grep and then give data from pipe it will occur an error
This example is supposed to xargs will put argument between grep and samplefile.
Using xargs with option -i for put argument to specified place
Using xargs with option -i , put { } to place that would like to put with output of left side of pipe .
same like this.
$ echo John | xargs -i grep John samplefile