Sorry typo Shell Scripting Question

2007-12-24 19:16:00

<html><DIV>
<DIV>Sorry there was a typo in script.</DIV>
<DIV>&nbsp;</DIV>
<DIV>What am I doing wrong?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The purpose of the script is to take the password field for shadow and insert it into the password field in /etc/passwd.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Here is what I'm trying to do.&nbsp; I'm trying to store the first field in /etc/passwd into a&nbsp;var and 3,4,5 and 6th fields, but I don't get any echo $REST?&nbsp;&nbsp; Why is the question</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks</DIV>
<DIV>&nbsp;</DIV>
<DIV>cat passwd | while read i<BR>do<BR>export i<BR>FIRST=`cut -d: -f1`<BR>REST=`cut -d: -f3-6`<BR>echo $FIRST<BR>echo $REST<BR>done<BR></DIV></DIV><br clear=all><hr>Get your FREE download of MSN Explorer at <a href="http://explorer.msn.com">http://explorer.msn.com</a><br>

</html>

Comments

Got something to say?

You must be logged in to post a comment.