$cd /bin

Brian Medley pub-lists-blu at bmedley.org
Sat Dec 1 19:17:18 EST 2007


On Sat, Nov 24, 2007 at 10:05:51AM -0500, Charles C. Bennett, Jr. wrote:

Hi,

One thing I don't understand about my OS (Mac OS Tiger) is this:

$ cat /usr/bin/cd
#!/bin/sh
# $FreeBSD: src/usr.bin/alias/generic.sh,v 1.1 2002/07/16 22:16:03 wollman Exp $
# This file is in the public domain.
${0##*/} ${1+"$@"}
$ 

What does this do?

> 
> On Wed, 2007-11-21 at 16:32 -0500, Kristian Erik Hermansen wrote:
> > On Nov 21, 2007 3:49 PM, Eric Chadbourne <EChadbourne at targetsite.com> wrote:
> > > #unexpected
> > >
> > > bash$ cd //
> > > bash$ pwd
> > > //
> > 
> > 
> > root at hermbuntu-desktop:~# pwd
> > /root
> > root at hermbuntu-desktop:~# env | grep PWD
> > PWD=/root
> > OLDPWD=/root
> > root at hermbuntu-desktop:~# cd //
> > root at hermbuntu-desktop://# pwd
> > //
> > root at hermbuntu-desktop://# env | grep PWD
> > PWD=//
> > OLDPWD=/root
> > -- 
> > Kristian Erik Hermansen
> > 
> 
> More fun....
> 
> cbox:ccb1001 cd //
> cbox:ccb1002 pwd
> //
> cbox:ccb1003 /bin/pwd
> /
> cbox:ccb1004 ls
> bcl/   dev/           home/        media/  net/   root/     srv/  usr/
> bin/   etc/           lib/         misc/   opt@   sbin/     sys/  var/
> boot/  fstab.replace  lost+found/  mnt/    proc/  selinux/  tmp/
> #
> #  note /opt is a symlink
> #
> cbox:ccb1005 cd opt
> cbox:ccb1006 pwd
> //opt
> cbox:ccb1007 /bin/pwd
> /bcl/cbox/System/opt
> cbox:ccb1008 cd $(/bin/pwd)
> cbox:ccb1009 pwd
> /bcl/cbox/System/opt
> cbox:ccb1010 /bin/pwd
> /bcl/cbox/System/opt
> 
> ccb
> 
> -- 
> Charles C. Bennett, Jr. <ccb at acm.org>
> 
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 
> _______________________________________________
> Discuss mailing list
> Discuss at blu.org
> http://lists.blu.org/mailman/listinfo/discuss

-- 
Brian Medley

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the Discuss mailing list