I have a KSH script that is working great on Solaris 10 Sparc, however I FTP this script to a different machine running Solaris 9, and now the #.LIVE.txt output is garbage when viewing from Web Browser. The original file shows fine, so it seems to be an issue with my Tail +15. I'm so confused. Please help.
Seems to be an issue with tail.
#!/usr/bin/ksh
# echo "Enter switch: \c"
# read switch
# echo "Enter username: \c"
# read username
# echo "Enter password: \c"
# read password
switch=$1
dt=$(date +%m%d%y_%H%M)
username=user
password=password
for x in 1
do
{
echo $username
sleep 5
echo $password
sleep 15
echo "cd /var/log"
sleep 5
echo "cat system_check.log"
sleep 10
echo "cd checks"
sleep 5
echo "ls -ltr"
sleep 5
echo "exit;"
}|telnet $switch>/export/public1/index_files/team_docs/bsmchklive/$switch.txt
cp /export/public1/index_files/team_docs/bsmchklive/$switch.txt /export/home/stlonse/data/bsmchk/$switch.CHK_$dt
done
tail +15 /export/public1/index_files/team_docs/bsmchklive/1.txt > /export/public1/index_files/team_docs/bsmchklive/1.LIVE.txt
tail +15 /export/public1/index_files/team_docs/bsmchklive/2.txt > /export/public1/index_files/team_docs/bsmchklive/2.LIVE.txt
tail +15 /export/public1/index_files/team_docs/bsmchklive/3.txt > /export/public1/index_files/team_docs/bsmchklive/3.LIVE.txt
tail +15 /export/public1/index_files/team_docs/bsmchklive/4.txt > /export/public1/index_files/team_docs/bsmchklive/4.LIVE.txt
tail +15 /export/public1/index_files/team_docs/bsmchklive/5.txt > /export/public1/index_files/team_docs/bsmchklive/5.LIVE.txt
tail +15 /export/public1/index_files/team_docs/bsmchklive/6.txt > /export/public1/index_files/team_docs/bsmchklive/6.LIVE.txt
Seems to be an issue with tail.
#!/usr/bin/ksh
# echo "Enter switch: \c"
# read switch
# echo "Enter username: \c"
# read username
# echo "Enter password: \c"
# read password
switch=$1
dt=$(date +%m%d%y_%H%M)
username=user
password=password
for x in 1
do
{
echo $username
sleep 5
echo $password
sleep 15
echo "cd /var/log"
sleep 5
echo "cat system_check.log"
sleep 10
echo "cd checks"
sleep 5
echo "ls -ltr"
sleep 5
echo "exit;"
}|telnet $switch>/export/public1/index_files/team_docs/bsmchklive/$switch.txt
cp /export/public1/index_files/team_docs/bsmchklive/$switch.txt /export/home/stlonse/data/bsmchk/$switch.CHK_$dt
done
tail +15 /export/public1/index_files/team_docs/bsmchklive/1.txt > /export/public1/index_files/team_docs/bsmchklive/1.LIVE.txt
tail +15 /export/public1/index_files/team_docs/bsmchklive/2.txt > /export/public1/index_files/team_docs/bsmchklive/2.LIVE.txt
tail +15 /export/public1/index_files/team_docs/bsmchklive/3.txt > /export/public1/index_files/team_docs/bsmchklive/3.LIVE.txt
tail +15 /export/public1/index_files/team_docs/bsmchklive/4.txt > /export/public1/index_files/team_docs/bsmchklive/4.LIVE.txt
tail +15 /export/public1/index_files/team_docs/bsmchklive/5.txt > /export/public1/index_files/team_docs/bsmchklive/5.LIVE.txt
tail +15 /export/public1/index_files/team_docs/bsmchklive/6.txt > /export/public1/index_files/team_docs/bsmchklive/6.LIVE.txt