Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion combine xargs with EOF
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
giuseppe.amatu...@gmail.com  
View profile  
 More options Oct 17 2012, 2:56 pm
Newsgroups: gnu.bash.bug
From: giuseppe.amatu...@gmail.com
Date: Wed, 17 Oct 2012 11:56:42 -0700 (PDT)
Local: Wed, Oct 17 2012 2:56 pm
Subject: Re: combine xargs with EOF
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.