Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!cs.utexas.edu!uunet!mcvax!ukc!acorn!ixi!clive From: clive@ixi.UUCP (Clive Feather) Newsgroups: comp.unix.wizards Subject: Re: network filenames Message-ID: <190@ixi.UUCP> Date: 21 Jun 89 16:15:19 GMT References: <1989Jun6.000120.14888@eci386.uucp> <216@cbnewsd.ATT.COM> <7095@cbmvax.UUCP> <3620@orca.WV.TEK.COM> Reply-To: clive@ixi.uucp (Clive Feather) Organization: IXI Limited Lines: 29 Summary: Expires: Sender: Followup-To: In article <3620@orca.WV.TEK.COM> andrew@frip.WV.TEK.COM (Andrew Klossner) writes: } "If find // to be both concise and from the *users* point of } view quite indicative of "something special". It seems that } only "wizards" get hung up on the point that is normally } semantically equivalent to / in file names." } >No, innocent programs get hung up too. For example, this shell script }fragment: } } cp input_file $HOME/tmp_file > }will, if run by root (with $HOME="/"), expand into: > } cp input_file //tmp_file } }and the kernel network code goes off in search of machine "tmp_file". Posix says that leading // is implementation defined, but all other cases of multiple slashes are equivalent to a single slash. The Rationale then tells you to concatenate using two slashes: cp input_file $HOME//tmp_file This will work unless $HOME=// (a very unlikely case). -- Clive D.W. Feather IXI Limited clive@ixi.uucp ...!uunet!ukc!ixi!clive (riskier)