mknod /tmp/oracle.pipe p
sqlplus / as sysdba << _EOF
set escape on
host nohup gzip -c < /tmp/oracle.pipe > /tmp/out1.gz \&
spool /tmp/oracle.pipe
select * from employee;
spool off
_EOF
rm /tmp/oracle.pip
I need to insert a trailer at the end of the zipped file out1.gz , I can count the lines using
count=zcat out1.gz |wc -l
How do i insert the trailer
T5 (assuming count=5)
At the end of out1.gz without unzipping it.
count=zcat out1.gz |wc -l
won't work, you need something likecount=$(zcat out1.gz |wc -l)
; ii)zcat
is unzipping the file, if you're willing to do that, why don't you wan to unzip? iii) Why don't you count the lines and add the number before compressing the file in the first place?