I have a simple file called dbs.txt I want to highlight the lines of this file on the screen using the for loop in bash.
The file is as follows:
db1 db2 db3 db4
The bash file is called test.sh, it looks like
for i in 'cat dbs.txt'; do echo $i done wait
When I run the file by typing:
bash test.sh
I get terminal output:
cat dbs.txt
instead of the expected
db1 db2 db3 db4
The following bash file works fine:
cat dbs.txt | while read line do echo "$line" done
Why does the first script not work?
source share