[CentOS] how to do repetetive command in shell

m.roth at 5-cent.us m.roth at 5-cent.us
Thu Oct 21 15:03:14 EDT 2010


Roland RoLaNd wrote:
>
> i'm writing a certain script which does a specific task in a repetitive
> manner, i'm going to give a similar script with the same concept hope you
> could advise me to a better way:
>
> USER1="roland"
> USER2="dany"
> USER3="kevin"
>
> cp -r /opt/$USER1/test /backup/$USER1
> cp -r /opt/$USER2/test /backup/$USER2
<snip>
Guy, if you're a real sysadmin, and not just doing this at home, you
*really* need to take a basic programming course. The first week or two
would have told you about what are called "control structures".

        mark



More information about the CentOS mailing list