#!/bin/bash diarypath=‘/home/quanwei/documents/diary/riji.riji‘ tempfile=`mktemp -u` vi $tempfile if [ -f $tempfile ]; then echo `date` >> $diarypath cat $tempfile >> $diarypath rm $tempfile echo 日记写入 else echo ‘文件为空而取消日记‘ ; fi
时间: 2024-12-27 22:51:39