Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i know by using command jobs we can see suspended jobs but when i tried by using man bg it only shows that these are bash builtins, please help me out??
try man bash (use /string to search for "string" then "/" agian to find the next match)
Code:
bg [jobspec ...]
Resume each suspended job jobspec in the background, as if it had been started with
&. If jobspec is not present, the shell’s notion of the current job is used. bg
jobspec returns 0 unless run when job control is disabled or, when run with job
control enabled, any specified jobspec was not found or was started without job
control.
fg [jobspec]
Resume jobspec in the foreground, and make it the current job. If jobspec is not
present, the shell’s notion of the current job is used. The return value is that
of the command placed into the foreground, or failure if run when job control is
disabled or, when run with job control enabled, if jobspec does not specify a valid
job or jobspec specifies a job that was started without job control.
i know by using command jobs we can see suspended jobs but when i tried by using man bg it only shows that these are bash builtins, please help me out??
Thnks!
The man for the bash builtins are part of the bash man page. The bash man page is huge and it is hard to find descriptions for each builtin. One way to search the bash man page is to make it into a txt file and then open that file in a text processor:
man bash > /home/user/mantext/bash.txt
mped /home/user/mantext/bash.txt
(or whatever editor you use)
A better way to make the man pages searchable is to use the lookat program:
Install lookat and then add to following command to /etc/profile, /home/user/.bashrc, and /root/.bashrc
export PAGER=/usr/local/bin/lookat
So using lookat here is what I found in the bash man pages about fg and bg:
Quote:
If the operating system on which bash is running supports job control, bash contains facilities to use it. Typing the suspend character (typically ^Z, Control-Z) while a process is running causes that process to be stopped and returns control to bash. Typing the delayed suspend character (typically ^Y, Control-Y) causes the process to be stopped when it attempts to read input from the terminal, and control to be returned to bash. The user may then manipulate the state of this job, using the bg command to continue it in the background, the fg command to continue it in the foreground, or the kill command to kill it. A ^Z takes effect immediately, and has the additional side effect of causing pending output and typeahead to be discarded.
bg [jobspec ...]
Resume each suspended job jobspec in the background, as if it had been started with &. If jobspec is not present, the shells notion of the current job is used. bg jobspec returns 0 unless run when job control is disabled or, when run with job control enabled, any specified jobspec was not found or was started with out job control.
fg [jobspec]
Resume jobspec in the foreground, and make it the current job. If jobspec is not present, the shell's notion of the current job is used. The return value is that of the command placed into the foreground, or failure if run when job control is disabled or, when run with job control enabled, if jobspec does not specify a valid job or jobspec specifies a job that was started without job control.
A meta-answer [ as jschiwal wrote earlier, which I just noticed ]: in my version of bash3, there is a built-in help command for built-ins:
Code:
#!/bin/bash3 -
# @(#) s1 Demonstrate help for shell built-ins in bash3.
echo "(Versions displayed with local utility \"version\")"
version >/dev/null 2>&1 && version =o $(_eat $0 $1)
echo
echo " Results of help:"
help bg
exit 0
Producing:
Code:
% ./s1
(Versions displayed with local utility "version")
Linux 2.6.11-x1
GNU bash 3.00.16(1)-release
Results of help:
bg: bg [job_spec]
Place JOB_SPEC in the background, as if it had been started with
`&'. If JOB_SPEC is not present, the shell's notion of the current
job is used.
See help help for details ... cheers, makyo
Last edited by makyo; 03-06-2008 at 10:16 AM.
Reason: jschiwal wrote in an ealier post.
It does look like man is doing this, but on the systems I use this is a function of the pager into which man is piping, which often is command less, sometimes more, etc ... cheers, makyo
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.