I want to know the minute of the day in a bash shell script, and at the moment I can only think to do this by piping two date commands with the hour of day and minute of hour to bc in this way:
mod=$(echo 60*$(date +%H)+$(date +%M) | bc)
echo $mod
This works, but is very clunky and not very elegant, is there a nicer way? I didn't see an option of minute of day in the date command.
I'm using bash version
4.4.20(1)-release