[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[debian-users:35607] Re: ファイルを同期するスクリプト
- From: Keni Matsuda <kenichi.matsuda@xxxxxxxxxx>
- Subject: [debian-users:35607] Re: ファイルを同期するスクリプト
- Date: Sun, 15 Dec 2002 09:14:42 +0900
- List-help: <mailto:debian-users-ctl@debian.or.jp?body=help>
- List-id: debian-users.debian.or.jp
- List-owner: <mailto:debian-users-admin@debian.or.jp>
- List-post: <mailto:debian-users@debian.or.jp>
- List-software: fml [fml 4.0.3 release (20011202/4.0.3)]
- List-unsubscribe: <mailto:debian-users-ctl@debian.or.jp?body=unsubscribe>
- X-ml-info: If you have a question, send e-mail with the body "help" (without quotes) to the address debian-users-ctl@debian.or.jp; help=<mailto:debian-users-ctl@debian.or.jp?body=help>
- X-ml-name: debian-users
- X-mlserver: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post)
- X-spam-level: *****
- X-spam-status: No, hits=5.5 required=10.0 tests=IN_REP_TO,ISO2022JP_CHARSET,PLING,ISO2022JP_BODY, CASHCASHCASH,UPPERCASE_25_50,HTTP_CTRL_CHARS_HOST, HTTP_ESCAPED_HOST,WEIRD_PORT,HTTP_USERNAME_USED version=2.31
- References: <3DFBBEB9.40104@xxxxxxxxxxx>
- Message-id: <20021214.191933.607960931.kenichi.matsuda@xxxxxxxxxx>
- X-mail-count: 35607
- X-mailer: Mew version 3.1 on XEmacs 21.4.10 (Military Intelligence)
> file1とfile2があるとき、最終更新日時があたらしい方を他方に上書きするスクリプトを
> つくりたいのですが、思い浮かびません。どんな方法がありますか。
Shell script で
if [ FILE1 -nt FILE2 ]; then
cp -p FILE1 FILE2
else
cp -p FILE2 FILE1
fi
でどうでしょうか。私はいうときは必ず
% man test
してみます。
----
Keni
=========================================================================
Kenichi (Keni) Matsuda E-Mail:kenichi.matsuda@xxxxxxxxxx
Server Globalization Technology Tel: 603-897-3260
Oracle Corporation New England Development Center Fax: 603-897-3317
One Oracle Drive, Nashua, NH 03062-2804, U.S.A.
=========================================================================