<br><br><div class="gmail_quote">On Thu, Jun 30, 2011 at 6:51 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">amritpal pathak wrote:<br>
> On Thu, Jun 30, 2011 at 4:37 AM, Nils Kassube <<a href="mailto:kassube@gmx.net">kassube@gmx.net</a>> wrote:<br>
</div><div class="im">> > > TEMP=$(mktemp)<br>
> ><br>
> > Make a temporary file which doesn't conflict with existing files.<br>
> ><br>
>      means temporary file with same name as original?<br>
<br>
</div>No, it is a file in /tmp created by mktemp with an arbitrary filename<br>
that did not yet exist. The filename is stored in the variable TEMP. We<br>
don't care about the actual file name because we handle everything with<br>
the variable instead. At the end the temp file is moved to the original<br>
file name anyway.<br></blockquote><div><br></div><div>     OK .Thanks for explanation.I got it.</div><div>    Sir can we make it more easier.?</div><div> Till now what i have did =>user will also enter the that part of the line which is not needed to change in original file.</div>
<div> suppose in orignal file line 9 holds:</div><div>  </div><div> device = /dev/ttyACM0 </div><div>  </div><div>      So in scripting i have use echo command  as:</div><div>    </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div><div></div><div class="h5">echo "Please enter your port address in a format => device = /dev/your-port-address "<br></div></div></blockquote><div><br></div><div>     What i think it is not right choice.He should enter only "ttyACM0" .Till now we are replacing the whole line .So how we can achieve it ?</div>
<div><br></div><div>Code is :</div><div><br></div><div><div>echo "Please enter your port address in a format => device = /dev/your-port-address "</div><div>read fname</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><div><br></div><div> </div><div><br></div><div>Thanks again !!</div><div><br></div><div><a href="http://amritpalpathakgne.wodpress.com">amritpalpathakgne.wodpress.com</a> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div class="h5">
<br></div></div></blockquote></div>