Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Changing contents of a LIST with a for loop

Options
  • 09-09-2008 11:48am
    #1
    Registered Users Posts: 5,580 ✭✭✭


    Hi this doesnt seem to work. Is there a way of changing the contents of an entire list?


    LIST1="RBS01 RBS02 RBS03 RBS04 RBS05"
    echo "LIST1 CURRENTLY $LIST1"
    for RBS in $LIST1
    do
    RBS="Changed$RBS"
    done
    echo "LIST1 CURRENTLY $LIST1"


Comments

  • Registered Users Posts: 6,465 ✭✭✭MOH


    Language?


  • Closed Accounts Posts: 10 uasal2000


    asumming php, your list needs to be cast as such otherwise it's just a string ie list("rbs01","rbs02")

    if this is perl then you can refer to the array using @ modifier instead of $ and split the array with qword.

    Hope this helps


Advertisement