From: Phil Pennock <phil.pennock@globnix.org>
To: zzapper <david@tvis.co.uk>
Cc: zsh-users@sunsite.dk
Subject: Re: Why doesn't tab expand .
Date: Tue, 10 Oct 2006 04:38:02 +0200 [thread overview]
Message-ID: <20061010023802.GA22913@parhelion.globnix.org> (raw)
In-Reply-To: <Xns9857CE0FC8AA4zzappergmailcom@80.91.229.5>
On 2006-10-09 at 19:15 +0000, zzapper wrote:
> Why doesn't tab expand . ?
To what?
"." is a directory, the "self" directory. It's not an alias or special
to the shell in any way. It's a directory entry which exists in every
directory, provided as part of the filesystem interface by the kernel;
on Unix-biased filesystems, it typically actually exists in the
filesystem. Without anything else, it's of course interpreted relative
to the current working directory.
If you view a directory as a file containing mappings from filenames to
inodes (the actual file structure on disk), then the filesystem
hierarchies exist from some inodes pointed-to also being directories.
Every directory contains items called "." and ".."; "." points to the
directory itself, ".." to the parent (which is why you can't hardlink a
directory to be in two locations (anymore)).
/usr/./bin/./foo is valid and the same as /usr/bin/foo but with some
extra checks in there.
So "." is a valid filename, referencing a directory; since there's no
'/' anywhere, it's the '.' which exists in $PWD, and effectively the
same as $PWD for most intents and purposes.
> > cp /tmp/fred.txt .<Tab>
>
> Be useful in a few cases?
Try $PWD<tab>
Regards,
-Phil
next prev parent reply other threads:[~2006-10-10 2:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-09 19:15 zzapper
2006-10-10 2:38 ` Phil Pennock [this message]
2006-10-11 9:13 ` zzapper
2006-10-11 16:38 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061010023802.GA22913@parhelion.globnix.org \
--to=phil.pennock@globnix.org \
--cc=david@tvis.co.uk \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).