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/tree_cover/TREE_COVER_$tile.tif /weldgfs/p51/gius_urban/pop_urban/tl_2010_us_uac10/UA_tree/UA_tree$tile.txt oft-stat $file /weldgfs/p51/gius_urban/LandCover/bare_ground/BARE_GROUND_$tile.tif /weldgfs/p51/gius_urban/pop_urban/tl_2010_us_uac10/UA_bare/UA_bare$tile.txt done in ls /weldgfs/p51/gius_urban/pop_urban/tl_2010_us_uac10/UA_tiff/*.tif | xargs -n 1 -P 10 bash -c ' file="$1" filename=`basename $file .tif` tile=${filename:3:6} echo processin $file oft-stat $file /weldgfs/p51/gius_urban/LandCover/tree_cover/TREE_COVER_$tile.tif /weldgfs/p51/gius_urban/pop_urban/tl_2010_us_uac10/UA_tree/UA_tree$tile.txt oft-stat $file /weldgfs/p51/gius_urban/LandCover/bare_ground/BARE_GROUND_$tile.tif /weldgfs/p51/gius_urban/pop_urban/tl_2010_us_uac10/UA_bare/UA_bare$tile.txt ' _ for multi process in parallel, without call an external script. . of course the echo $1 was a way to simplify the full task. Now the script works fine Thanks to all you Ciao Giuseppe