Find the answer to your Linux question:
Results 1 to 2 of 2
Ok not sure if this is the right place for this but here it goes... I am trying to create a simple counter which when running selects a value from ...
  1. #1
    Just Joined!
    Join Date
    Aug 2007
    Posts
    3

    newbie needs a counter

    Ok not sure if this is the right place for this but here it goes...
    I am trying to create a simple counter which when running selects a value from a list
    i.e.
    The list is:
    a1=123
    a2=456
    a2=789
    etc

    then in the code where is says coordinates= the appropiate value will appear
    i.e.
    coordinates=a1 therefore coordinates=123,123
    coordinates=a2 therefore coordinates=456,456
    coordinates=a3 therefore coordinates=789,789

    it would end up echoing:
    ......output=z1 cooridnate=123,123 obs_elev=................

    This is what i have so far



    Code:
    #!/bin/sh
    #
    DIST=60000
    H=1.75
    DEM=Aber7
    ####################
    #begin loop
    for(( i=1; i<=2; i++))
    do
    
    #select appropiate coordinate
    a1=123
    a2=456
    ##################
    
    echo "calculating Line of Site for Site ${i}"
    echo "r.los input=$DEM output=z${i} coordinates=$a1 obs_elev=$H max_dist=$DIST"
    
    
    
    ################
    #end of loop
    
    
    done
    exit
    Thanks

    Gary

  2. #2
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    I don't understand the problem. Your script looks good. What's the question?
    DISTRO=Arch
    Registered Linux User #388732

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...