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

Shell script to paste same file again inside file but append n to each iteration

Options
  • 22-01-2011 9:29pm
    #1
    Registered Users Posts: 5,580 ✭✭✭


    Hi folks

    Ok heres my issue

    I have a file containing configuration info for 1 node

    I want to make the file so that i can configure 100 such nodes . Nothing changes except the node name

    So if i call the first one "node1", i want to do the second as "node2", third as node3 etc

    Here is the pseudocode

    n=1
    while (n <=100)
    do
    Append the value of n to the value of the node in this file
    n=n+1
    end do

    Is there a handy shell script command to do ? My sed and awk is rusty at best

    Thanks if you can help


Comments

  • Registered Users Posts: 2,781 ✭✭✭amen


    There is a least post on this already. Search the forum you should find it.

    Might be from 2-3 years ago


Advertisement