Problem in making a script

amritpal pathak amritpalpathak1 at gmail.com
Thu Jun 30 04:01:35 UTC 2011


On Wed, Jun 29, 2011 at 4:08 PM, Colin Law <clanlaw at googlemail.com> wrote:

> On 29 June 2011 14:33, amritpal pathak <amritpalpathak1 at gmail.com> wrote:
> >
> >
> >
> > I tried syntax given by you as:
> >  TEMP=$(mktemp)
> > head -n $(($4 - 1)) "$abc.tex" > "$TEMP"
> > echo "$fname" >> "$TEMP"
> > LEN=$(cat "$abc.tex"|wc -l)
> > tail -n $(($LEN - $4)) "$abc" >> "$TEMP"
> > mv "$TEMP" "$abc.tex"
> >                  Here abc.tex file is a file which i want to edit at line
> > number 4.
> > name is accepted from user.but when i ran it as "sh filename.sh",it gave
> > following error.
> > head: cannot open `.tex' for reading: No such file or directory
> > cat: .tex: No such file or directory
> > a.sh: 27: arithmetic expression: expecting primary: "0 - "
> >
> >                      I am sure i am wrong somewhere.Please help sir
>
> I know that you use Ruby as you also post in the Ruby on Rails list,
> so you could write a Ruby script to do it rather than having to
> struggle with a new language.

         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

Thanks
amritpalpathakgne.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20110630/b64f2693/attachment.html>


More information about the ubuntu-users mailing list