#!/bin/sh
#Saying the system time out loud
time= date +"%T"
say The current time now is, $time. Bye.
The script is printing out the time, not saying it.
#!/bin/sh
#Saying the system time out loud
time= date +"%T"
say The current time now is, $time. Bye.
The script is printing out the time, not saying it.
You don't need to assign the variable as you can just include the output of date
like this
#!/bin/sh
#Saying the system time out loud
say "The time is now $(date +%T). Thank you."
Try using a HereDoc like this ...
bash-3.2$ cat <<EOT
> The current time is now, `date +"%T"`
> EOT
The current time is now, 19:49:16
time= date +"%T"
you want to set time
to the stdout of the date
command, so you want $(date +%T)
(the double quotes around %T
aren't necessary as %
doesn't have a special meaning in this context).
printing out the time, not saying it."
Fixing your syntax , it works for me and recently vocalized the time as "twenty one forty six twenty seven" for example.
time=$(date +%T)
say the time is $time
Okay, this worked. Thank you. :) Appreciate the help!
#!/bin/sh
#Saying the system time out loud
time=$(date +"%T")
say The time is now $time. Thank you.