Re: useful shell shortcuts



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
.



Relevant Pages

  • Re: Mikes linux projects list, introducing "mcsh"!
    ... > The ability to run a command in the parent process AFTER the child ... > Think of a batch program in Windows that changes the directory of the ... A shell script can do the same. ... > mcsh will have only ONE command for newbies to remember, ...
    (comp.os.linux.misc)
  • Re: My PC just broke down.... :(
    ... >Windows just reboots mid-operation. ... the command to invoke it is 'chkdsk'. ... >>> assumed that this was the common Windows command shell (a'la DOS ... >> And of course lets not forget that all the Windows help files are ...
    (comp.sys.mac.advocacy)
  • Re: Why no output display when I input at console
    ... this means Unix and Windows) have "." ... operating systems", hinting at DOS, possibly OS/2 and Windows; ... PATH, but it is instead proper to the DOS, OS/2 and Windows command ... shells that the shell looks for an executable by the given name of the ...
    (comp.unix.shell)
  • Re: My PC just broke down.... :(
    ... Windows just reboots mid-operation. ... All it said was to type exit to reboot. ... >> assumed that this was the common Windows command shell (a'la DOS ...
    (comp.sys.mac.advocacy)
  • My recent Epiphany about operating systems
    ... In Winblow$, the release & bundling of IE was purposely as crippleware, virus, & bug delivery system 2 trap people into constantly 'upgrading'. ... A simple comparisson of Windows 95 side-by-side with the final Windows ME & various IE 'upgrades' illustrates how the supposedly 'new & improved' stuff is actually about 1/5 the speed, ... The OS Kernels are designed to require constant patching or nothing runs properly when 'upgrading' softwares. ... Just like M$ writes Windoze 2 B full of bugs, so they can keep selling the same crap over & over "oh but we fixed it this time" - yeah right:)) I am still using the shell from Windows95. ...
    (freebsd-questions)