我需要将一个给定的日期格式(hh:mm:ss)分成如:10:30:50的变量,如:hour = 10; 在bash脚本中,minute = 30和seconds = 50 whit grep.
我得到的时间不是一个变量,例如:time ="10:30:50"而我只得到带有以下表达式的秒数:
秒=echo $time | grep -oE "[^:]+$"
echo $time | grep -oE "[^:]+$"
获得分钟和小时的任何帮助?
linux bash grep
bash ×1
grep ×1
linux ×1