I have a simple shell script as follows:
#!/bin/bash
OUTPUT="network.$(date +'%d-%m-%y').info.txt"
SUPPORT_ID="email"
echo "---------------------------------------------------" > $OUTPUT
echo "Run date and time: $(date)" >> $OUTPUT
echo "---------------------------------------------------" >> $OUTPUT
ifconfig >> $OUTPUT
echo "---------------------------------------------------" >> $OUTPUT
echo "Network info written to file: $OUTPUT."
echo "Please email this file to: $SUPPORT_ID."
It just dumps the network config into a file. At some point I will have the file emailed out, but right now I'm just trying to figure out why the output looks like the following?
bash ./test.sh
.etwork info written to file: network.26-01-25.info.txt
.lease email this file to: email
Why in the world does the initial character of the last couple of "echo" commands get clipped and turned into periods? The echos for the output of the commands piped into the output file are fine. Strange...
Any ideas?
Post
Replies
Boosts
Views
Activity
I have a simple shell script as follows:
#!/bin/bash
OUTPUT="network.$(date +'%d-%m-%y').info.txt"
SUPPORT_ID="emailaddress"
echo "---------------------------------------------------" > $OUTPUT
echo "Run date and time: $(date)" >> $OUTPUT
echo "---------------------------------------------------" >> $OUTPUT
ifconfig >> $OUTPUT
echo "---------------------------------------------------" >> $OUTPUT
echo "Network info written to file: $OUTPUT."
echo "Please email this file to: $SUPPORT_ID."
It just dumps the network config into a file. At some point I will have the file emailed out, but right now I'm just trying to figure out why the output looks like the following?
bash ./test.sh
.etwork info written to file: network.26-01-25.info.txt
.lease email this file to: emailaddress
Why in the world does the initial character of the last couple of "echo" commands get clipped and turned into periods? The echos for the output of the commands piped into the output file are fine. Strange...
Any ideas?