Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Apr 1995 04:16:25 -0700
From:      asami@cs.berkeley.edu (Satoshi Asami | =?ISO-2022-JP?B?GyRCQHUbKEI=?= =?ISO-2022-JP?B?GyRCOCsbKEIgGyRCOC0bKEI=?=)
To:        hackers@FreeBSD.org
Subject:   strange behavior with sh and dangling symlinks
Message-ID:  <199504231116.EAA27389@silvia.HIP.Berkeley.EDU>

next in thread | raw e-mail | index | archive | help
The below is on a 0416-snap system Rod put together for me.  (It
happens on older systems too.)

=====
>> sh
$ ls
$ mkdir a 
$ ln -s ../b a
$ echo */b
*/b
$ touch b
$ echo */b
a/b
$ /bin/rm b
$ echo */b
*/b
$ echo a/*
a/b
$ ls -lL a
total 0
lrwxr-xr-x  1 asami  grad  4 Apr 23 04:11 b -> ../b
$
=====

In short, "*/filename" doesn't expand properly when the target of the
symlink doesn't exist.  "dirname/*" does expand, so this is
inconsistent, to say the least.

This happens only in sh.  tcsh and bash expands everything fine.

(I found this trying to track down why bsd.port.mk was behaving
 funnily when I removed the "real" package in .packages/ before
 removing the symlinks in other subdirs....)

Satoshi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504231116.EAA27389>