Problem in making a script

amritpal pathak amritpalpathak1 at gmail.com
Wed Jun 29 13:33:22 UTC 2011


 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

Thanks you

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


More information about the ubuntu-users mailing list