[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help - Getting lots of errors from functions and scripts

Sven Joachim wrote the following on 12/22/2008 12:55 PM:
On 2008-12-22 15:09 +0100, Dennis Wicks wrote:

When I run anything that is actually a shell script starting with
#!/bin/sh and maybe any thing that uses a shell function I get five or
six screens full of messages that look like the following and all
start with /bin/sh

	/bin/sh: _openssl: line 25: syntax error near
		`unexpected token `('
	/bin/sh: _openssl: line 25: ` -@(in|out|oid))'
	/bin/sh: error importing function definition for
	/bin/sh: _service: line 4: syntax error in
		conditional expression: unexpected token `('
	/bin/sh: _service: line 4: syntax error near `@(*'
	/bin/sh: _service: line 4: ` [[ ${COMP_WORDS[0]} !=
@(*init.d/!(functions|~)|service) ]] && return 0;'

One example is  /usr/bin/bashbug

These functions seem to be defined in /etc/bash_completion.

but all scripts that start with  #!/bin/sh
seem to have the problem.

One function that has the problem is one I wrote that does an ls and
pipes it to less. As follows;

	function lm ()
    		ls -laNF "$@" | $(which less)

Anybody have any idea about what is causing these errors
or where to look?

Maybe /etc/bash_completion contains some code that bash doesn't like
when it's called as sh.  But another question is why a non-interactive
shell even reads that file.  That's a misconfiguration for which I don't
really have an explanation.


These are interactive shells, terminal windows in gnome. At least the initial command is entered on th cl

Just for giggles I reinstalled bash-completion and it made no difference.

Also determined that it happens in the non-root terminal window but not in the root. I first discovered it with fakeroot.

Any other ideas, let me know!


Reply to: