>From: Jonas Munsin <[EMAIL PROTECTED]>
>On Sat, Oct 07, 2000 at 01:17:39PM -0400, Mike A. Harris wrote:
>> Which illustrates an important issue I recommend to
>> everyone. When copying or moving files to a DIRECTORY, specify
>> that that is what you are intending by prepending a trailing
>> "/" on to the end. Thus if you do:
>>
>> cp *.h /usr/local/include/
>>
>> If that directory does not exist you will get an error instead of
>> a mess. ANY time I use a directory on the commandline of ANY
>> command in Linux, or in a script, I ALWAYS use a trailing "/" as
>> it prevents this problem. If you're worried about double slashes
>> being used via scripts, don't worry, it is handled correctly, for
>> example:
>>
>And this is of course utterly non-portable:
>aton:~/tmp$ uname -a
>SunOS aton 5.6 Generic_105181-17 sun4u sparc SUNW,Ultra-2
>aton:~/tmp$ echo 1234 > file
>aton:~/tmp$ ls -l
>total 2
>-rw------- 1 jmunsin infpersonal 5 Oct 10 12:42 file
>aton:~/tmp$ cp file dir/
>aton:~/tmp$ ls -l
>total 4
>-rw------- 1 jmunsin infpersonal 5 Oct 10 12:42 dir
>-rw------- 1 jmunsin infpersonal 5 Oct 10 12:42 file
IIRC, this is correct :-(
There has been a discussion about this on the UNIX-2000 mailing list
some time ago. I believe this is a side effect of the POSIX
requirements for path handling.
The same happens on FreeBSD 5.0
Linux behaves as BSD-4.2 did and this is considered a bug from POSIX view.
So the best way to prevent such things is to use something like the
schily makefile system that implements the right rules to first create
the directory (if missing) and then to install the file.
J�rg
EMail:[EMAIL PROTECTED] (home) J�rg Schilling D-13353 Berlin
[EMAIL PROTECTED] (uni) If you don't have iso-8859-1
[EMAIL PROTECTED] (work) chars I am J"org Schilling
URL: http://www.fokus.gmd.de/usr/schilling ftp://ftp.fokus.gmd.de/pub/unix
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]