<br><br><div class="gmail_quote">On Sat, Jul 2, 2011 at 5:07 AM, Nils Kassube <span dir="ltr"><<a href="mailto:kassube@gmx.net">kassube@gmx.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Amrit Pal Pathak wrote:<br>
>  Till now what i have did =>user will also enter the that part of the<br>
> line which is not needed to change in original file.<br>
>  suppose in orignal file line 9 holds:<br>
><br>
>  device = /dev/ttyACM0<br>
><br>
>       So in scripting i have use echo command  as:<br>
> > echo "Please enter your port address in a format => device =<br>
> > /dev/your-port-address "<br>
><br>
>      What i think it is not right choice.He should enter only<br>
> "ttyACM0" .Till now we are replacing the whole line .So how we can<br>
> achieve it ?<br>
<br>
</div>You could extend the echo command with the rest of the text you need in<br>
the line. Something like this:<br>
<br>
echo -n "Please enter device name: "<br>
read device<br>
...<br>
echo "device = /dev/$device" >> "$TEMP"<br>
  Here $TEMP is temporaily file name?<br></blockquote><div>      Can I use here a variable then can replace $fname with   </div><div>     that variable in following code.</div><div>   </div><div>sudo wget <a href="http://202.164.53.116/~amritpal/edit/kannel.conf">http://202.164.53.116/~amritpal/edit/kannel.conf</a></div>
<div>sudo chmod a+w kannel.conf</div><div>echo -n "Please enter device name: "</div><div>read device</div><div>echo "device = /dev/$device" >> "$TEMP"</div><div>TEMP=$(mktemp)</div><div>
head -n $((29 - 1)) "kannel.conf" > "$TEMP"</div><div>echo "$fname" >> "$TEMP"</div><div>LEN=$(cat "kannel.conf"|wc -l)</div><div>tail -n $(($LEN - 29)) "kannel.conf" >> "$TEMP"</div>
<div>mv  "$TEMP" "kannel.conf"</div><div><br></div><div>  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
However I would really suggest you learn bash scripting with the help of<br>
one of the manuals I mentioned in a previous mail. Or as an alternative<br>
I can recommend the O'Reilly book "Learning the bash shell" by<br>
Cameron Newham & Bill Rosenblatt. </blockquote><div><br></div><div>   Ok i will read it now.Thanks. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Yes, that takes time but that way you<br>

know what you are doing and you don't have to ask for every tiny detail<br>
and then hope for a useful answer.<br>
<div><div></div><div class="h5"><br>
Thanks again.</div></div></blockquote><div>    <a href="http://amritpalpathakgne.wordpress.com">amritpalpathakgne.wordpress.com</a>  </div></div>