1
vote
2answers
58 views

I need to augment my output to include cat-ing a file in this Bash script

I have a script querying a remote server based on user input and looks for the last modified date of a file. It works, however, contained in the file is a string that I need to have displayed as well ...
1
vote
2answers
127 views

Redirect to stdin instead of argument when using xargs [closed]

for exmaple, using the command cat foo.txt | xargs -I{} -n 1 -P 1 sh -c "echo {} | echo" The foo.txt contains two lines foo bar The above command print nothing.
1
vote
2answers
99 views

xargs “too long argument list”

I want to do something like this: cat 5.txt | xargs -0 openssl prime but xargs is saying that argument list is too long Edit: cat 3.txt | xargs -n 1 openssl prime | wc -l works, thanks
0
votes
2answers
142 views

xargs remove file name containing $

I am using xargs to remove files from remote server. xargs -a /var/log/del.log -i -exec ssh root@abc.com 'rm -rf "{}"' del.log contains path of the files which are deleted on local server and I ...
0
votes
3answers
147 views

join xargs' output by newlines

I want to join output of the xargs output by new lines. I do this: find . -name '*.txt' | xargs -n 1 iconv -f UTF-16 | ...other-commands... I take one file at a time and convert it to UTF-8 (the ...
2
votes
1answer
230 views

Xargs and bash script

The script works fine when executed manually but I recived the folloing error while it's run as a cron job: xargs: postsuper: No such file or directory #!/bin/bash mailgueue=$(mailq | awk ...
3
votes
4answers
2k views

prevent xargs from quitting on error

According to the man page, xargs will quit if one of the execution lines exits with an error of 255: If any invocation of the command exits with a status of 255, xargs will stop immediately ...
12
votes
6answers
7k views

Newline-separated xargs

Is it possible to make xargs use only newline as separator? (in bash on Linux and OS X if that matters) I know -0 can be used, but it's PITA as not every command supports NUL-delimited output.
2
votes
2answers
5k views

Apply multiple .patch files

I have a directory with .patch files, generated using diff. I would like to apply all those patches using patch -p1 to another directory. But patch takes only one file, unless I cat. What would the ...
0
votes
2answers
384 views

Is the svn nightly commit script built to capture all possible scenarios?

I have a nightly svn commit script that should take into account all possible scenarios and commit new things to our svn repository. Basically I am running the following steps: svn status [path] to ...