Red Hat Bugzilla – Bug 134138
percent (%) command fails to find stopped job
Last modified: 2007-11-30 17:07:13 EST
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):
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".
The syntax to do what you want is: "%%".
for the upstream maintainer's rationale.
*** Bug 139736 has been marked as a duplicate of this bug. ***
Seems the old behavior can be achieved by using `alias %=%%', would such an
alias have any unintentional side effects?