i have simple program that generate log file 1 line every sec, i need to do grep for specific record then redirect to another file.
#!/bin/bash
for i in `seq 1 20`;
do
echo $i
sleep 1
done
./test.sh |egrep "5|10|15"
5
10
15
r
./test.sh |egrep "5|10|15" >> test.txt
test.txt always empty before the test.sh terminted.
on the real software the script is never terminated , is it possible to redirect the output before test.sh command process terminated?
sorry for my bad english