当前位置: 技术问答>linux和unix
shell 如何将以下两条表达式合成一条呢?
来源: 互联网 发布时间:2016-02-04
本文导语: shell 如何将以下两条表达式合成一条呢? PMONTH=`date +%m` PMONTHFILE=monitor_`echo "$PMONTH - 1" | bc`.log | #!/bin/sh PMONTH=`date +%m` PMONTHFILE=monitor_`echo "$PMONTH - 1" | bc`.log echo $PMONTHFILE _file="monitor_"`expr `date +%m` - 1`"....
shell 如何将以下两条表达式合成一条呢?
PMONTH=`date +%m`
PMONTHFILE=monitor_`echo "$PMONTH - 1" | bc`.log
|
#!/bin/sh
PMONTH=`date +%m`
PMONTHFILE=monitor_`echo "$PMONTH - 1" | bc`.log
echo $PMONTHFILE
_file="monitor_"`expr `date +%m` - 1`".log"
echo ${_file}
_file="monitor_"`echo `date +%m` - 1 | bc`".log"
echo ${_file}
PMONTH=`date +%m`
PMONTHFILE=monitor_`echo "$PMONTH - 1" | bc`.log
echo $PMONTHFILE
_file="monitor_"`expr `date +%m` - 1`".log"
echo ${_file}
_file="monitor_"`echo `date +%m` - 1 | bc`".log"
echo ${_file}