Greetings All,
I hope that someone can help me here. I have the following script where I would like to have the output on a single line.
below is my script that I would hope to do.
# # # # # # # # #
#!/bin/bash
#set -x
STARTHOME=$(date +%s)
sleep 60
ENDHOME=$(date +%s)
echo "HOME Time :" $((ENDHOME-STARTHOME)) | awk '{print int($1/60)":"int($1%60)}'
echo ""
echo "# This should appear in two lines"
echo "HOME Time :"
echo $((ENDHOME-STARTHOME)) | awk '{print int($1/60)":"int($1%60)}'
# # # # # # # # #
Below is what I see in the output.
The output that I would like to see is as follows.
llamprec@ICANWeb:~$ ./test.sh
# This should appear in a single line.
0:0
# This should appear in two lines
HOME Time :
1:0
I have also tried to delete the carriage return on the first line "Home Time :", but this did not work either.
Can someone please point me into the right direction as to how can I get the output on a single line.
Thanks in advance
Lawrence
I hope that someone can help me here. I have the following script where I would like to have the output on a single line.
below is my script that I would hope to do.
# # # # # # # # #
#!/bin/bash
#set -x
STARTHOME=$(date +%s)
sleep 60
ENDHOME=$(date +%s)
echo "HOME Time :" $((ENDHOME-STARTHOME)) | awk '{print int($1/60)":"int($1%60)}'
echo ""
echo "# This should appear in two lines"
echo "HOME Time :"
echo $((ENDHOME-STARTHOME)) | awk '{print int($1/60)":"int($1%60)}'
# # # # # # # # #
Below is what I see in the output.
The output that I would like to see is as follows.
llamprec@ICANWeb:~$ ./test.sh
# This should appear in a single line.
0:0
# This should appear in two lines
HOME Time :
1:0
I have also tried to delete the carriage return on the first line "Home Time :", but this did not work either.
Can someone please point me into the right direction as to how can I get the output on a single line.
Thanks in advance
Lawrence