Errors on shell infile -


i got text file test.txt

a b c d e 

and shell script

filename="test.txt"  while ifs= read -r line;     echo "$line"     if [ "$line" = "a" ]                   echo "abc"     fi  done < "$filename" 

i expect see line "abc" after "a" got is:

a b c d e 

any suggestions on what's wrong?


Comments

Popular posts from this blog

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

javascript - Replicate keyboard event with html button -