I wrote the following script. I want to read a file and print as line by line but it considering space as new line. why is that?
#!/bin/bash
for i in `cat data.txt`
do
echo $i
done
Input: Saved in file name data.txt
B FM_Server10_grp GPCBIOEMM10 Y N ONLINE
Output:
B
FM_Server10_grp
PCBIOEMM10
Y
N
ONLINE
Another question: How can I extract only number value like 10
from GPCBIOEMM10
?
cat data.txt
directly. – Wildcard Dec 18 '15 at 20:57