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.

When man declare in bash, I get the manpage of declarein sql. But I would like to get the manage of declare in shell. How can I do that?

share|improve this question
add comment

3 Answers

up vote 6 down vote accepted

The information for declare in bash doesn't have a manpage for itself, it's part of man bash.

You can access the information for bash's declare using help declare, or help -m declare if you like the manpage layout. or search for declare within the bash manpage.

In general, when there are more then one manpage with the same name, you specify the one you need using the section number, such as man 1 info for the info program and man 5 info for the info file format. or you can do man -a info to see them all.

To know which file will be opened, do man -w commend, so man -aw command shows them all.

share|improve this answer
add comment

Unix man pages are split into 8 sections. You can specify the section before the subject argument, such as:

man 3 man

however, I do believe the information you're looking for on declare will be located in the bash man page. Open the bash man page and search for declare, like so:

man bash
/declare

/ will begin an incremental search within the current man page. To find the next occurence of the search press n.

share|improve this answer
add comment

declare is one the bash builtins, so you can read up on it with man builtins

man -k bash lists all of the different man pages associated with bash - which will show you that man bash-builtins will also work.

share|improve this answer
    
man builtins doesn't provide any useful information, (at-least not on my system), it just lists all builtins and refers to the bash manpage. –  Philomath Jul 31 '11 at 3:15
    
Odd. On Ubuntu there is a full section on declare, including all of the switches: unix.com/man-page/All/7/builtins –  jasonwryan Jul 31 '11 at 5:22
    
OK, good to know. The standard builtins manpage coming with bash (bash-4.2.tar.gz/bash-4.2/doc/builtins.1) is just a pointer as I described. –  Philomath Jul 31 '11 at 5:39
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.