Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jul 2003 17:13:30 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        sedwards@qrwsoftware.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Any way to stop a remote box gone crazy?
Message-ID:  <20030723221330.GA61570@dan.emsphone.com>
In-Reply-To: <1058997629.3f1f057d216d3@webmail.xmission.com>
References:  <1058981768.3f1ec788d0125@webmail.xmission.com> <1058995718.3f1efe06829fa@webmail.xmission.com> <1058996340.3f1f007432094@webmail.xmission.com> <20030723144439.C68935@thor.65535.net> <20030723215524.GF3178@dan.emsphone.com> <1058997629.3f1f057d216d3@webmail.xmission.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Jul 23), sedwards@qrwsoftware.com said:
> Quoting Dan Nelson <dnelson@allantgroup.com>: 
> > In the last episode (Jul 23), Rus Foster said: 
> > > > cd seems to work (I can cd to directories that I know exist,
> > > > but get an error if I try to cd to a directory that doesn't),
> > > > but echo always just returns *
> > >  
> > > hmm strange...it could be the shell as echo * on mine does and ls 
> >  
> > "echo *" in an empty directory will print "*", since /bin/sh passes
> > unmatched patterns through.
> >  
> > --  
> > 	Dan Nelson 
> > 	dnelson@allantgroup.com 
> >  
>  
> But I would think that this means the shell couldn't open the
> directory to get the filenames to match?

That's also a possibility.  You can use cat to tell the difference
though..  Here's a "ls" shell function that knows the difference
between an empty directory and one it can't read.  Unfortunately, it
requires cat, whereas plain "echo *" is done without forking:

ls () { cat . > /dev/null && echo * ; }

-- 
	Dan Nelson
	dnelson@allantgroup.com



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