LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-31-2013, 05:20 AM   #1
nerdofdarkness
LQ Newbie
 
Registered: Oct 2013
Posts: 28
Blog Entries: 1

Rep: Reputation: Disabled
Why does bash sometimes give me numbers in my prompt, but not all the time?


Most of the time my shell prompt looks normal.

However, if I cancel something with control-C, or if there's a file that's not found, the shell sometimes puts numbers in there as if it's telling me how many errors I've made.

Code:
user@verdant:~/Downloads > gem install taskjuggler-3.5.0.gem 
^CERROR:  Interrupted
[1]user@verdant:~/Downloads > gem install taskjuggler
Fetching: mime-types-1.25.gem (100%)
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied - /var/lib/gems
[1]user@verdant:~/Downloads > ^C
[130]user@verdant:~/Downloads > sudo gem install taskjuggler
Fetching: mime-types-1.25.gem (100%)
The [1] and [130] don't usually show up - they seem to indicate an error condition.

Why is bash doing this to me?

Thanks.
 
Old 10-31-2013, 06:06 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,505

Rep: Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434
see the prompt settings: echo $PS1
 
1 members found this post helpful.
Old 10-31-2013, 06:19 AM   #3
ntu929
Member
 
Registered: Jun 2010
Location: India
Distribution: Ubuntu
Posts: 128

Rep: Reputation: 4
I also face this problem when there is some problem with the network driver.So do check it.


Quote:
Originally Posted by nerdofdarkness View Post
Most of the time my shell prompt looks normal.

However, if I cancel something with control-C, or if there's a file that's not found, the shell sometimes puts numbers in there as if it's telling me how many errors I've made.

Code:
user@verdant:~/Downloads > gem install taskjuggler-3.5.0.gem 
^CERROR:  Interrupted
[1]user@verdant:~/Downloads > gem install taskjuggler
Fetching: mime-types-1.25.gem (100%)
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied - /var/lib/gems
[1]user@verdant:~/Downloads > ^C
[130]user@verdant:~/Downloads > sudo gem install taskjuggler
Fetching: mime-types-1.25.gem (100%)
The [1] and [130] don't usually show up - they seem to indicate an error condition.

Why is bash doing this to me?

Thanks.
 
Old 10-31-2013, 08:26 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
I believe that is the job control identification number.

When a command gets suspended (either directly or due to some command directing it), the shell assigns a number to the command stream. This allows you to resume that stream.

You should be able to list these with the "jobs" command that is built into bash.
 
1 members found this post helpful.
Old 11-01-2013, 01:07 AM   #5
nerdofdarkness
LQ Newbie
 
Registered: Oct 2013
Posts: 28
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
see the prompt settings: echo $PS1

Code:
> echo $PS1
\[\033[0;31m\]$(returncode)\[\033[0;37m\]\[\033[0;35m\]${debian_chroot:+($debian_chroot)}\[\033[0;35m\]\u@\h\[\033[0;37m\]:\[\033[0;36m\]\w >\[\033[0;00m\]

So I guess "1" and "130" are 'returncode' values.
 
Old 11-01-2013, 01:10 AM   #6
nerdofdarkness
LQ Newbie
 
Registered: Oct 2013
Posts: 28
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
I believe that is the job control identification number.

When a command gets suspended (either directly or due to some command directing it), the shell assigns a number to the command stream. This allows you to resume that stream.

You should be able to list these with the "jobs" command that is built into bash.
'jobs' lists commands that were started in the current terminal.

Since I normally use at least two or three terminals, I usually have to use 'ps -ef' to list what's going on.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Format numbers using bash? KClaisse Programming 21 03-30-2015 07:47 AM
[SOLVED] Make Bash prompt look like Windows C:\ prompt -- *PROBLEM* arkadios Linux - General 5 07-24-2012 12:29 PM
bash: display CURRENT time in prompt? exscape Linux - Software 9 07-23-2012 06:03 AM
give a parameter or string by default to the prompt after booting from CD/DVD vikas027 Linux - Software 2 03-11-2011 01:12 PM
gnome-terminal fails to give bash prompt wfhoney Red Hat 8 04-21-2004 04:38 PM


All times are GMT -5. The time now is 03:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration