<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:10pt;font-family:Sans">
<p>On Tuesday 17 May 2005 17:14, linux.whiz@gmail.com wrote:</p>
<p>> On 5/17/05, kevin.kempter@dataintellect.com</p>
<p>></p>
<p>> <kevin.kempter@dataintellect.com> wrote:</p>
<p>> > You get this behavior because the internal field separator by default</p>
<p>> > recognizes spaces, tebs, etc as field separators.</p>
<p>> ></p>
<p>> > Try this instead (where names.lst is your file of names):</p>
<p>> ></p>
<p>> > exec < ./names.lst</p>
<p>> > while read line</p>
<p>> > do</p>
<p>> >         myscript.sh $line</p>
<p>> > done</p>
<p>></p>
<p>> As soon as I issue the exec < ./names.lst command, my shell exits.  My</p>
<p>> understanding is that exec takes over the PID of the current process,</p>
<p>> so when you try to exec a text file it makes sense that the process</p>
<p>> would exit.</p>
<p>></p>
<p>> Other ideas?</p>
<p>></p>
<p>> LW</p>
<p></p>
<p>The exec thing usually works for me. Maybe you already have stdin tied up???</p>
<p></p>
<p>Here's a bit of a hokey fix but it should work.</p>
<p></p>
<p></p>
<p>1) make your names.lst file look like this with a dash (-) as a replacement for any spaces</p>
<p>John-A-Smith</p>
<p>Mary-P-James</p>
<p>Sally-R-Jones</p>
<p>Fred-Q-Davis</p>
<p></p>
<p>then do this in your script:</p>
<p></p>
<p></p>
<p></p>
<p><span style="color:#000b00">for i in `cat names.lst`; do</span></p>
<p><span style="color:#000b00">   username=`echo $i | sed "s/-/ /g"`</span></p>
<p><span style="color:#000b00">   myscript.sh $username</span></p>
<p><span style="color:#000b00">done</span></p>
<p></p>
</body></html>