for i in `ls -d /opt`<div><div>do</div><div>cp /opt/${i}/test/ /backup/${i}</div><div>done</div><div><br><br><div class="gmail_quote">On Thu, Oct 21, 2010 at 14:45, Roland RoLaNd <span dir="ltr"><<a href="mailto:r_o_l_a_n_d@hotmail.com">r_o_l_a_n_d@hotmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">



<div>
Dear all,<br><br>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:<br><br><br>USER1="roland"<br>

USER2="dany"<br>USER3="kevin"<br><br><br>cp -r /opt/$USER1/test /backup/$USER1<br>cp -r /opt/$USER2/test /backup/$USER2<br><br><br>such a command would be repeated 832 times (this is just an example) <br>

so instead of copying the above line 832 times and appending that user's number in each "$USER"<br><br>is there a way to do it in a  smarter way ?<br><br><br>thanks,<br><br>--Rolad<br><br>                                          </div>

<br>_______________________________________________<br>
CentOS mailing list<br>
<a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
<a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br> John Kennedy<br><br>
</div></div>