日報を自動作成する以下略
結局以下のように落ち着いた。Mac版
#! /bin/sh fpath=${1:-~/日報/} #日報のファイルパス cd $fpath format_date=${2:-"%Y_%m_%d"} #日付フォーマット today=`date +"${format_date}"`".txt" #今日の日付 例:2011_02_28 previous_day=`ls -t *.txt | head -1` if [ -z $previous_day ] ; then echo "過去のテキストファイルが見つかりません。" exit 1 fi #ファイルが存在していればコピーしない if [ -e $fpath$today ] ; then echo $fpath$today"は存在しています" else `cp $fpath$previous_day $fpath$today` fi
(defun open-nippou() (interactive) (defvar shellscript "~/hello.sh") (defvar nippou "~/日報/") (defvar time-format "%Y_%m_%d") (setq isFile (shell-command (concat shell " " nippou " " time-format ))) (defvar file_name (concat (format-time-string time-format) ".txt")) (if (equal isFile 0) (find-file (concat nippou file_name )) ) )