Hi, does anyone know if it's possible for xargs to take it's stdin and create 1 single parameter for it.
Example I want this python script's
first argument to say 'hello world' like this:
Code:
$ python -c 'import sys;print sys.argv[1]' 'hello world'
hello world
If however I pipe a 'hello world' string to xargs I only get the 'hello' as the first argument and 'world' as the second, but I want them both as the 1st argument:
Code:
$ echo 'hello world' | xargs python -c 'import sys;print sys.argv[1]'
hello
$ echo 'hello world' | xargs python -c 'import sys;print sys.argv[2]'
world
Is there a way for xargs to take a literal input and use just as the first parameter. The idea is to pipe long messages (from emails etc) to the first parameter of a program, so treading all special characters as literals from xargs is what I want.