I am sure there are many ways to do this. If I understand what you are
trying to do correctly, I would do the following (I am sure there are
more elegant ways, but this is easy for me to read):
-------------------------------------------
#!/bin/sh
if [[ $# = 0 ]]
then
echo 'usage is test.scr (file1) (file2) (file3)'
exit
fi
typeset -i icount
icount=0
# Read 3rd line from first file
exec 3< ${1}
until [[ icount -eq 3 ]]
do read -u3 line1
icount=icount+1
done
exec 3<&-
icount=0
# Read 2nd line from first file
exec 3< ${2}
until [[ icount -eq 2 ]]
do read -u3 line2
icount=icount+1
done
exec 3<&-
# put them together in a new file
exec 3> ${3}
print -u3 ${line1}${line2}
exec 3>&-
exit
------------------------------------------
Hope this helps.
Justin
--
-----------------------------------------------
Justin W. Russell
Senior Engineer, Aerodynamics/CFD
Lockheed Martin Aeronautics Company - Marietta
86 South Cobb Drive
Marietta, GA 30063-0685
Tel: (770) 494-6303
Fax: (770) 494-3055
-----------------------------------------------
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.