|
Help in unix
Hi,
I am a beginner in unix shell scripting. I wish to do the following things:
a) Read 3 new lines from a file (file2.txt) and appending them at the end of another file file1.txt.
I wrote the script as follows:
#! /bin/sh
set i = 0
set count =0
count = (wc -l file2.txt)
while(i -le $count)
do
i = i + 3;
head -i file2.txt >> file1.txt
done
I am getting an error in line "count = (wc -l file2.txt)". There is something wrong with my syntax because the script is not working. Please help.
Thanks
Last edited by guest6; 05-16-2008 at 01:31 PM.
|