Re: xargs combined with awk

2012-12-21 Thread giuseppe . amatulli
thanks to all of you. in the end i selected the following solution -c $' awk \'{}\' ' all the best giuseppe On Thursday, 20 December 2012 09:43:50 UTC-6, giuseppe...@gmail.com wrote: > Hi, > > have this a for loop which is sending the "dir" variable one for each > processor.

xargs combined with awk

2012-12-20 Thread giuseppe . amatulli
Hi, have this a for loop which is sending the "dir" variable one for each processor. for dir in UA_tile_tif_pop_txt UA_buf10_tile_tif_pop_txt UA_buf20_tile_tif_pop_txt UA_buf30_tile_tif_pop_txt UA_buf40_tile_tif_pop_txt UA_buf50_tile_tif_pop_txt ; do echo $dir ; done | xargs -n 1 -P 6 bash -c

Re: combine xargs with EOF

2012-10-17 Thread giuseppe . amatulli
so this is my actual gol: change this loop ( which is working fine ) for file in /weldgfs/p51/gius_urban/pop_urban/tl_2010_us_uac10/UA_tiff/*.tif ; do filename=`basename $file .tif` tile=${filename:3:6} echo processin $file oft-stat $file /weldgfs/p51/gius_urban/LandCover/tre

Re: combine xargs with EOF

2012-10-17 Thread giuseppe . amatulli
Sorry i was not clear, yes my purpose is " simply to avoid having a second file containing a bash script " but find . -maxdepth 1 -name '*.txt' -print0 | xargs -n 1 -P 10 bash -c 'echo "$1" ' or ls '*.txt' | xargs -n 1 -P 10 bash -c 'echo $1 ' do not print $1 so the argument (-n

combine xargs with EOF

2012-10-17 Thread giuseppe . amatulli
Hi i'm using often xargs to run process in parallel ls *.txt | xargs -n 1 -P 10 bash myscript.sh where myscript.sh is (for examples of course is longer): echo $1 i would like to perform the same operation using the EOF syntax and import the arguments inside the eof I tried ls *.txt | xargs