Bug 134138 - percent (%) command fails to find stopped job
Summary: percent (%) command fails to find stopped job
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: bash
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
: 139736 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-09-29 19:34 UTC by Kevin Sanders
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-09-30 08:31:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Kevin Sanders 2004-09-29 19:34:01 UTC
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 
expected.


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


How reproducible:
Always

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 08:31:17 UTC
The syntax to do what you want is: "%%".

Please see:
http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00191.html

for the upstream maintainer's rationale.

Comment 2 Tim Waugh 2004-11-17 21:49:58 UTC
*** Bug 139736 has been marked as a duplicate of this bug. ***

Comment 3 Kasper Dupont 2005-04-20 12:46:46 UTC
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.