Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

It may look like this: [2] 2847. I guess the first digit is just an enumeration of processes created from the shell. The second is the PID. Anyway, I never care about that information so it is just annoying to see. Is there a way to turn it off? (I found that set +bm in .bashrc disabled the process termination message.)

share|improve this question
    
AFAIK no there isn't. –  Ulrich Dangel Jun 5 '12 at 22:17
    
Alright, good to know so I don't waste time looking. –  Emanuel Berg Jun 5 '12 at 22:31
add comment

1 Answer

up vote 5 down vote accepted

The first number is the job index; job-related commands (jobs, fg, etc.) use them. So for example, if you get the output [2] 2847, you could run fg 2 to foreground that job.

As far as I could tell from skimming the source, there isn't a way to disable the message. The one check it does do is to ensure the shell is interactive, so if you run the command in a non-interactive shell you won't get that output. For example, you could run it in a subshell:

$ (your_command &)

That's equivalent to running the command in an entirely different shell though, so it might have other undesired side-effects

If you're willing to patch bash, you can just get rid of that particular output. In bash 4.2 it's in jobs.c on line 1428:

fprintf (stderr, "[%d] %ld\n", job + 1, (long)pid);

It gets called in other circumstances; if you just want it gone for this particular case, you can comment out execute_cmd.c, line 762:

DESCRIBE_PID (last_made_pid);
share|improve this answer
    
Hm, this would be one way: alias skype="(skype &)" - it works, and you don't have to type the extra stuff - but 1) you'd like a general solution, as you never know what tools you'll use, and 2) It'll break those tools for any other usage, say you'd like to add an option flag, so patching is much better. I'll get to it :) –  Emanuel Berg Jun 5 '12 at 22:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.