3 ms·
Comments are closed on that page, so instead I will comment here. There's no need to use xargs, and pipe to sh in this scenario. The same functionality can be
by noodly 15y ago
Comments are closed on that page, so instead I will comment here.
There's no need to use xargs, and pipe to sh in this scenario. The same functionality can be achieved by using only find:
PROCS=8;cuffs=`which cufflinks`;find `pwd` -name 'accepted_hits.bam' -type f -exec qsub -l ncpus=$PROCS -- $cuffs -p $PROCS -o {}-cufflinks -g genes.gtf {} \;
- barrkel 15y agoCreating a text stream which you then pipe to a shell is a good way of debugging complex operations, especially potentially destructive ones that may need inspection to verify. It's a technique I use a lot, to the point that some of my more destructive scripts don't do anything - they just output shell commands, and it's up to me to pipe them to the shell.
- noodly 15y agoYou can achieve this also by using find and its -ok option, instead of -exec, that way find will ask for confirmation before doing anything.
- JOnAgain 15y agoThanks for the -ok option. was not aware -- but yeah, I've been a heavy user of -exec option for years, and it always blows my mind when people get crazy complicated xargs going.
- barrkel 15y agoThat's not the same thing at all; I could emulate that in a script with 'read' and 'if', but that's not what I do.