[Gllug] a more intelligent shell

- Tethys tethys at gmail.com
Mon May 15 13:15:44 UTC 2006


On 5/14/06, SteveC <steve at asklater.com> wrote:

> Just now I type 'grepp' rather than 'grep' and got the familiar command
> not found message. This is frustrating and it'd be nice if it knew that
> I'd made a typo.

Bash can do this when changing directories (shopt -s cdspell), which
will correct minor typos such as transposed characters, and 1 too many
or too few characters in the directory name. However, it doesn't do it
for commands, for the reasons others have stated. DWIM is just too
prone to (potentially catastrophic) failure.

> Perhaps something like auto-complete in a browser address (not just tab
> completion but showing stuff too) bar but more intelligent so it knows
> something about command line options

Both bash and zsh can do something similar to this. Look at the
Programmable Completion section in bash(1). You can program it to know
about the arguments taken by a given command. It won't sanity check
the command before you run it, which I think is what you want, but you
can use tab completion and it'll only give you valid arguments to that
command. Thus you could have ssh only complete names of valid remote
hosts, for example.

Tet
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list