I have a simple bash script that reads lines from a text file like so:
#!/bin/bash
FILE=$1
while read line; do
...
done < $FILE
which works fine but now I want to first parse the file using grep like so :
INPUT_file=$(grep -E 'INPUT.*ACCEPT' $FILE)
and then assign that result to the variable INPUT_file
I would like to now read lines from the variable "INPUT_file" but when I try to include in the while loop:
while read line; do
....
done < $INPUT_file
I get the following error:
$INPUT_file: ambiguous redirect