Re: useful shell shortcuts
- From: Gandalf Parker <gandalf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 07 Dec 2006 14:16:32 GMT
Henry Townsend <henry.townsend@xxxxxxxx> contributed wisdom to
news:84SdnSHoou0pcOvYnZ2dnUVZ_oidnZ2d@xxxxxxxxxxx:
There are two features I've often wished for in my shell (ksh) and am
wondering if any other shell has them.
(1) Due to finger-fumbles I often type just "/some/dir" when I meant
'cd /some/dir" or "pushd /some/dir", which results in the error message
"/some/dir: cannot execute". Since the idea of executing a directory is
clearly preposterous, why can't the shell interpret this as a cd (or
pushd) request?
It would be abit hard for the system to tell. So each command line needs
to know that you werent preceding a directory to a command or checking
for existence of a file vs directory. Or maybe the error could catch it.
That would take care of the first example anyway.
(2) Similarly, I sometimes type "file" instead of "vi file". But why
can't the shell be configurable to run "$EDITOR file" in that case iff
the file exists as named? Yes, it does have an icky Windows-ish feeling
but that doesn't mean it couldn't be useful. This one I've sort-of
implemented with a "trap ... ERR" hack in the past but it wasn't ideal
for reasons I no longer remember.
Default file handlers like Windows has? That allows some of the invasion
techniques that windows has problems with. Is this worth that?
Gandalf Parker
.
- References:
- useful shell shortcuts
- From: Henry Townsend
- useful shell shortcuts
- Prev by Date: Re: how to change user in shell
- Next by Date: Re: Bash: extract first 'word' from array
- Previous by thread: Re: useful shell shortcuts
- Next by thread: Want to replace SPACE delimited data file with commas
- Index(es):
Relevant Pages
|