I am trying to display certain details using a bash script but the output of the bash script differs from the output of the terminal.
Terminal Output:
ubuntu@ubuntu:~/ubin$ cat schedule.text | grep 09/06/12
Sat 09/06/12 Russia 00:15 Czech Republic A
Sat 09/06/12 Netherlands 21:30 Denmark B
ubuntu@ubuntu:~/ubin$
Bash Script Output:
ubuntu@ubuntu:~/ubin$ bash fixture.sh
Sat 09/06/12 Russia 00:15 Czech Republic A Sat 09/06/12 Netherlands 21:30 Denmark B
ubuntu@ubuntu:~/ubin$
As you can see the output of the bash script differs from the output of the terminal. My bash script output has everything in a single line.
fixture.sh:
A=$(date +%d/%m/%y) #get today's date in dd/mm/yy fmt
fixture=$(cat /home/ubuntu/ubin/schedule.text | grep $A)
echo $fixture
So, my question is how do I make my bash script output similar to the terminal output?