Forum Topic

Thanks for your participation and contribution.


Back to Linux

Simple bash read line

Post a reply
253 views
i90runner
i90runner

Simple Bash read line

while read -r line; do echo "$line"; done <inputfile.txt
i90runner
i90runner
#!/bin/bash
input="/path/to/txt/file"
while IFS= read -r line
do
  echo "$line"
done < "$input"

1-2 of 2

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.