<br><br><div class="gmail_quote">On Wed, Jun 29, 2011 at 2:35 PM, 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>
> Thank you very much .<br>
> it is working <a href="http://now.it" target="_blank">now.it</a> is<br>
> replacing the user's input with line number 4's content in abc file<br>
> but it also removes the contents which are after the line number 4<br>
> i.e 5,6,7 so on.everyline gets remove.<br>
> It is not feasible<br>
><br>
> Why?<br>
<br>
</div>Well, there probably is no file "abc" but only "abc.tex" ...<br>
<div class="im"> ok Sir<br>
> tail -n $(($LEN - 4)) "abc" >> "$TEMP"<br>
<br>
</div>This line should be<br>
<br>
tail -n $(($LEN - 4)) "abc.tex" >> "$TEMP"<br>
<div><div></div><div class="h5"> great !!.<br></div></div></blockquote><div> it is working now.you guys are rock!!</div><div> But still i am little bit confuse to understand it "how it is happening".Please sir,tell me what each line is doing .It will make me fully understand it</div>
<div><br></div><div><div>TEMP=$(mktemp)</div><div>head -n $((4 - 1)) "abc.tex" > "$TEMP"</div><div>echo "$fname" >> "$TEMP"</div><div>LEN=$(cat "abc.tex"|wc -l)</div>
<div>tail -n $(($LEN - 4)) "abc.tex" >> "$TEMP"</div><div>mv "$TEMP" "abc.tex"</div><div>exit 0</div></div><div><br></div><div> Thank you very much.</div><div><br></div><div><a href="http://amritpalpathakgne.wordpress.com">amritpalpathakgne.wordpress.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>