<br><br><div class="gmail_quote">On Wed, Jun 29, 2011 at 4:08 PM, Colin Law <span dir="ltr"><<a href="mailto:clanlaw@googlemail.com">clanlaw@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On 29 June 2011 14:33, amritpal pathak <<a href="mailto:amritpalpathak1@gmail.com">amritpalpathak1@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> I tried syntax given by you as:<br>
> TEMP=$(mktemp)<br>
> head -n $(($4 - 1)) "$abc.tex" > "$TEMP"<br>
> echo "$fname" >> "$TEMP"<br>
> LEN=$(cat "$abc.tex"|wc -l)<br>
> tail -n $(($LEN - $4)) "$abc" >> "$TEMP"<br>
> mv "$TEMP" "$abc.tex"<br>
> Here abc.tex file is a file which i want to edit at line<br>
> number 4.<br>
> name is accepted from user.but when i ran it as "sh filename.sh",it gave<br>
> following error.<br>
> head: cannot open `.tex' for reading: No such file or directory<br>
> cat: .tex: No such file or directory<br>
> a.sh: 27: arithmetic expression: expecting primary: "0 - "<br>
><br>
> I am sure i am wrong somewhere.Please help sir<br>
<br>
</div></div>I know that you use Ruby as you also post in the Ruby on Rails list,<br>
so you could write a Ruby script to do it rather than having to<br>
struggle with a new language. </blockquote><div> yes u are right.but now i have started it already.I will learn how to make scripts in ruby but now i am in between and just one step away so please see if anybody can help </div>
<div><br></div><div>Thanks </div><div><a href="http://amritpalpathakgne.wordpress.com">amritpalpathakgne.wordpress.com</a> </div></div>