[ILUG] odd behaviour in bash

Badger badger at scattermail.com
Mon Aug 28 19:27:15 IST 2006


On Mon, Aug 28, 2006 at 12:20:39PM +0100, Rob Gallagher wrote:
> Hi Domenico,
> 
> Yeah it only seems to occur in bash, I recently switched from using zsh
> - where this problem never appeared. Also installed the bash-completion
> scripts recently if that's any help.
> 
> rg
> 
> On Fri, 25 Aug 2006 15:35:29 +0100
> Domenico Gentile <Domenico.Gentile at CardBASE.com> wrote:
> 
> > Rob,
> > 	It couldn't be something obvious as a faulty keyboard could
> > it?
> > 
> > Is it only in bash and not (say) ksh?
> > 
> > Dom
> > 
> > -----Original Message-----
> > From: Rob Gallagher [mailto:robert at kerna.ie]
> > Sent: 25 August 2006 12:51
> > To: ilug at linux.ie
> > Subject: [ILUG] odd behaviour in bash
> > 
> > 
> > Running bash 3.1.17.
> > 
> > The odd time, when I pass an argument to a command - say for example
> > editing a file in vi - the shell will prompt me for further input, as
> > if I'd put a semicolon after the first argument. Going back through
> > the history, it appears as if that's what bash thinks I did.
> > 
> > Anyone come across this before?
> > 
> > rg
> > 


Actually, what it sounds like it's doing is replacing your command
arguments with the character "-". I can't think of anything off-hand
that would explain this behaviour outright, but I can suggest some ways
to investigate the problem.

If it's convienient, you might want to start by just removing the bash
completion scripts to see if they are the cause. I know nothing about
these scripts but I imagine there is a fairly good chance that something
in there is to blame.

You could check what aliases are configured in your shell with the
"alias" command.

You could check how bash is configured by typing "bash -o" and then
looking at the man page for bash to see what the configuration options 
mean. 

There is a bash builtin command called "complete" that is possibly
relevent to the problem at hand. You will find it described along with
its options under the section "SHELL BUILTIN COMMANDS" in the bash man
page. 

A good place to start debugging this problem is to find out how the
system thinks you called the program. You can do this by trying to start
your program (eg "vim doss.txt") and then when it hangs waiting for
input, do a "ps wuax | grep vim" from another shell and see what the
command line arguments look like. 

That should get you started debugging this for the moment. Let us know
how you get on - you've sparked my curiosity.

- badge




More information about the ILUG mailing list