bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: combine xargs with EOF


From: giuseppe . amatulli
Subject: Re: combine xargs with EOF
Date: Wed, 17 Oct 2012 11:56:42 -0700 (PDT)
User-agent: G2/1.0

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]