Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Changing contents of a LIST with a for loop

  • 09-09-2008 11:48AM
    #1
    Registered Users, Registered Users 2 Posts: 5,758 ✭✭✭


    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, Registered Users 2 Posts: 6,475 ✭✭✭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