例子:sh脚本#!/bin/shdate2=$(date +%Y-%m-%d)' '$(date +%H:%M:%S)echo 'date2:'$date2打印出的结果是:date2:2012-11-22 14:34:32
原文:https://www.iteye.com/blog/jinnaxu-tju-edu-cn-1733270