Bug 134138 - percent (%) command fails to find stopped job
percent (%) command fails to find stopped job
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: bash (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
: 139736 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2004-09-29 15:34 EDT by Kevin Sanders
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-09-30 04:31:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Kevin Sanders 2004-09-29 15:34:01 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Description of problem:
When bringing stopped or backgrounded jobs to the foreground, the 
percent command can be used as a shortcut for "fg".  Specifically,
"%-", "%+", "%pattern", or just plain "%" indicate the desired job.  
The latter, the plain "%", should be a synonym for "%+" and 
foreground the job last suspended or backgrounded.  This has been the 
behavior of previous versions of bash, and of the older csh.

For some reason, the simplest form of this command, "%", no longer 
finds the job.  Instead I get this message:

-bash: fg: %: no such job

When I don't use the % shortcut and use fg instead, it behaves as 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Start a program that can be suspended, such as vim.
2.  Suspend the program.
3.  Use the % command.

Actual Results:  Job is not resumed.

Expected Results:  Should have been the same as if I had entered "fg".

Additional info:
Comment 1 Tim Waugh 2004-09-30 04:31:17 EDT
The syntax to do what you want is: "%%".

Please see:

for the upstream maintainer's rationale.
Comment 2 Tim Waugh 2004-11-17 16:49:58 EST
*** Bug 139736 has been marked as a duplicate of this bug. ***
Comment 3 Kasper Dupont 2005-04-20 08:46:46 EDT
Seems the old behavior can be achieved by using `alias %=%%', would such an
alias have any unintentional side effects?

Note You need to log in before you can comment on or make changes to this bug.