I have a csv file that I loop through and pick only some lines. Like that:
while read p; do
if [[ "$p" =~ '0'$ ]]; then
echo "$p"
fi
done <$1
I would like the picked records to be appended to the original file, like this
- old_records
- "Picked records:"
- new_appended_record
However, when I add >> $1
at the end of my script I seem to enter into an infinite loop.