2009-09-29から1日間の記事一覧

2つのファイルの日付を比べる関数

関数名: IsNewer 書式: IsNewer file1 file2 目的: file2よりfile1の日付が新しければ0を返し、そうでなければ1を返す IsNewer() { if [ $# -ne 2 ]; then echo "Usage: IsNewer file1 file2 " 1>&2 exit 1 fi if [ ! -f $1 -o ! -f $2 ]; then exit 1 fi if…

ファイルやディレクトリの完全パス名を表示する関数

関数名: FullName 書式: FullName filename | directory 目的: 指定されたファイルやディレクトリを完全パス名で表現したものを返す FullName() { _CWD=`pwd` if [ $# -ne 1 ]; then echo "Usage: FullName filename | directory" 1>&2 exit 1 fi if [ -d $1…