I am running this bash script:
#!/bin/sh
date +"%Y-%m-%d %H:%M:%S " | tr -d 'n' >> /home/test_a5gh/Pub_IP.txt
curl http://checkip.amazonaws.com?newline -s >> /home/test_a5gh/Pub_IP.txt
cat /home/test_a5gh/Pub_IP.txt
After creating the above file, I placed it in the folder /home/test_a5gh/
and then I made the script executable:
$ sudo chmod u+x testip.sh
Next, to test the script, I ran:
$ ./testip.sh
However, the output of this command is being produced on 2 lines. Here is an example:
2011-22-33 16:10:27
111.222.333.444
I need the output to appear on 1 line, like this:
2011-22-33 16:10:27 111.222.333.444
Additional Information:
The script is taken from here.
Question:
Is there a way to get this output on 1 line?