Newsgroups: fj.questions.unix
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!news.join.ad.jp!news.imnet.ad.jp!ripspost.aist.go.jp!news.tisn.ad.jp!is.s.u-tokyo!mech.t.u-tokyo.ac.jp!t-server!news.nc.u-tokyo.ac.jp!newssinet!news.ipc.chiba-u!news.tj.chiba-u!asada
From: asada@ics.tj.chiba-u.ac.jp (Takuya Asada)
Subject: Re: no overwrite 'mv'
Message-ID: <DGooI0.4EB@ics.tj.chiba-u.ac.jp>
Sender: usenet@ics.tj.chiba-u.ac.jp
Nntp-Posting-Host: icsj6.tj.chiba-u.ac.jp
Organization: Chiba-University
References: <KAGIMOTO.95Oct19132907@ocean6.geoph.s.u-tokyo.ac.jp>
Date: Thu, 19 Oct 1995 06:53:59 GMT
Lines: 35
Xref: galaxy.trc.rwcp.or.jp fj.questions.unix:4996
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.questions.unix&nb=4996&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

$B$"$5$@$J$N$G$9!#(B

$B80K\$5$s(B> 
> $B$d$O$j(B perl $B$NJ}$,JXMx$=$&$G$9$M!#(B

$B$^$!!"$3$N%F$N=hM}$K$O%3%h%J%/JXMx$G$9$M!#<B$O:G=i(B sh $B$G=q$3$&$H(B
$B$7$?$N$G$9$,!"!V:G8e$N0z?t!W$r%$%C%Q%D$G<h$j=P$9J}K!$r9M$($k$N$,(B
$BLLE]$G!"$d$a$F$7$^$C$?$N$G$7$?!#(B

# $B%(%l%,%s%H$JJ}K!$J$$$G$9$+$M$'!D(B

> if ( $#ARGV < 1 ) {

$B$3$l$O!"0z?t$,ITB-$7$F$$$k>l9g$O(B mv $B$KEO$5$l$?;~E@$G%(%i!<$K$J$k(B
$B$N$G!"$"$($FIU$1$^$;$s$G$7$?!#(B

> unless ( @f == "" ) {

$B$=$G$9$M!"$3$N%A%'%C%/$O$"$C$?J}$,%$%$$+$b$7$l$^$;$s!#(B

$B$"$H!"0\F0@h$,$"$k$+$J$$$+$r(B -f $B$G%O%s%F%$$7$^$7$?$,!"F1$8L>A0$N(B
$B%G%#%l%/%H%j$H$+$"$k$H!"$A$g$C$H%"%l$G$9$M!D(B

$B$H$$$&Lu$GD{@5HG$O(B

#!/usr/local/bin/perl
$d = pop(@ARGV);
for (@ARGV) { push(@f, $_) unless (-e $d."/".$_); }
system "mv @f $d" if (@f);

$B$H$$$C$?%H%3%m$G$9$+!#(B

$B$"$5$@(B $B$?$/$d(B


