LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 03-21-2013, 05:37 AM   #1
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Rep: Reputation: 28
Bash errors when terminal is started


I have just updated kubuntu 12.04.2, and now get the following when I start a terminal window:
Code:
bash: _python: line 15: syntax error near unexpected token `('
bash: _python: line 15: ` !(?(*/)python*([0-9.])|-?))'
bash: error importing function definition for `_python'
bash: _k3b: line 21: syntax error near unexpected token `('
bash: _k3b: line 21: ` _filedir @(cue|iso|toc);'
bash: error importing function definition for `_k3b'
bash: _xz: line 15: syntax error near unexpected token `('
bash: _xz: line 15: ` --decompress | --list | --test | -!(-*)[dlt]*)'
bash: error importing function definition for `_xz'
bash: _tar: line 8: syntax error near unexpected token `('
bash: _tar: line 8: ` ?(-)[cr]*f)'
bash: error importing function definition for `_tar'
bash: _growisofs: line 12: syntax error near unexpected token `('
bash: _growisofs: line 12: ` /?(r)dev/*)'
bash: error importing function definition for `_growisofs'
What is causing them?
 
Old 03-21-2013, 06:16 AM   #2
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Which terminal is that(xterm, rxvt)? Does that happen in the virtual consoles too when you press ctrl+alt+(F1-F6) and login? One of the files that define the terminal session is broken, that is for sure, but which one?

Regards
 
Old 03-21-2013, 08:04 AM   #3
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
Someday I hope to be more observant. Not likely though. And more precise in the problem description...

I've found that the problem only occurs when I 'su' for a root prompt and give the root password. I know that root shells are frowned upon, but sometimes it is convenient.

Starting a shell in konsole or emacs or a vc is not a problem, and 'sudo su' with my user password is not a problem.

At least I know how to avoid the errors now.
Could it be a path problem? Or perhaps ~/.bashrc?

'su' alone gives me a shell with /root as the home directory and $USER = root, and errors
'sudo su' keeps my usual home directory and $USER = root, but no errors
'kdesu emacs' gives me /root, $USER = root, and no errors. (I start the shell automatically.)

I'll keep looking.

Last edited by CollieJim; 03-21-2013 at 08:21 AM. Reason: Mire details
 
Old 03-21-2013, 09:03 AM   #4
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Quote:
Originally Posted by CollieJim View Post
..
Could it be a path problem? Or perhaps ~/.bashrc?

'su' alone gives me a shell with /root as the home directory and $USER = root, and errors
...
I'll keep looking.
It is something in the root user config files looks like, .bashrc or .profile , look in the lines where the error messages are pointing, compare the files in other machines if you can.
Have you tried su - ? su - In Debian work as su in Ubuntu and in Debian just su work as sudo su in Ubuntu.

Regards
 
Old 03-23-2013, 03:21 AM   #5
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
I've found another instance.
From konsole or the emacs shell invoking a script from /usr/local/bin which does not start with #! will give the errors.

It looks like there is a python script somewhere that cannot find modules.
/usr/bin/python is linked to python2.7.
 
Old 03-28-2013, 02:20 AM   #6
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
I have put echos at the beginning and end of /etc/bash.bashrc, /etc/profile/, ~/.bashrc, and ~/.profile.

When I enter a command that is built-in, no errors
When the command is not built-in, I get the errors. None of the echos are displayed.

It appears to be internal to bash.
 
Old 03-28-2013, 03:29 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
probably the SHELL variable is overwritten?
you can try set -x and strace
 
Old 03-28-2013, 04:17 AM   #8
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
set returns 86 lines of variable values, and 7632 lines of function definitions!
Where do they come from? I've tried grep on /etc and /usr and nothing shows. Possibly because they are in a compressed file?

The problem code seems to be in these functions. It looks like there is something in the problem strings that case does not like.
 
Old 03-28-2013, 04:26 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
see man bash and look for the login process to see what is happening
 
Old 03-28-2013, 09:21 PM   #10
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
The errors are in bash_completion.d files.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do you bring up terminal in background started with startup script in Gnome? EODSteven Linux - Newbie 16 10-02-2012 01:28 PM
learning bash, where to get started? Cultist Linux - General 4 09-26-2011 02:23 PM
Trying to restore lilo and my hdd after it started getting errors, wont boot ? zonemikel Linux - Software 6 08-23-2009 11:00 PM
trouble with VNC in gnome-rdp started through terminal via ssh (Xubuntu 7.10) sehku17 Linux - Software 2 05-01-2008 06:47 PM
not ALL applications can be started from the terminal. randell6564 Ubuntu 13 06-10-2006 11:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 02:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration