in the beginners book i have it gives an exercise to try. saying to make a script that examines the time. it should keep examining every second or so and say some sort of message. Can anyone help me get going.
Thanks
in the beginners book i have it gives an exercise to try. saying to make a script that examines the time. it should keep examining every second or so and say some sort of message. Can anyone help me get going.
Thanks
#!/bin/ksh
min=`date +%M`
sec=`date +%S`
# you now have minutes and seconds total seconds = seconds + ( minutes*60)
total=`echo "$sec + ($min * 60)" | bc`
# now you have total seconds... go from here
ok i think i have it written ok, how do you save it so i can run again later
make a file
I just use cat for make executable file
try this :
cat<<EOF>mytime
#!/bin/ksh
min=`date +%M`
sec=`date +%S`
echo ' "$sec + ($min * 60)" | bc '
EOF
chmod +x mytime
and then try to type mytime in u'r shell