LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-21-2006, 03:24 PM   #1
yewchong
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Rep: Reputation: 0
Man pages, how to create and reference them


Hi,

I would like to seek advice on how to go about creating man pages and then reference them.

I have actually followed instructions on this website: _w_w_w.unixreview.com/documents/s=1350/ur0312i/,

What I did was copied the sample file, and name it sample.1. Afterwhich, I put it in my home directory and executed it as follows:
man -M ~ sample

However, it seems that the sample file is not found. Would like to seek some pointers on how to proceed on. Thanks!

[Edited]
note: the _w_w_w, replace with www.

By the way, I have also tried the man -l sample command, but doesn't work either.

Last edited by yewchong; 03-21-2006 at 03:26 PM.
 
Old 03-21-2006, 03:50 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,359
Blog Entries: 55

Rep: Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546
I would like to seek advice on how to go about creating man pages and then reference them. (..) However, it seems that the sample file is not found.
- add the location to your MANPATH (man manpath) or
- (if it's in a temporary location) just specify /path/to/manpage.1
 
Old 03-21-2006, 04:43 PM   #3
yewchong
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Hi,

Am sorry, as I am relatively new to linux, and yes, I am using it temporarily.
I tried the command below:

man /home/yewchong/sample.1 sample

However, I realised that this is in fact making man find both /home/yewchong/sample.1 and sample.

I believe I might have understood you wrongly as to executing the man command. Would therefore seek any clarifications. Thanks!
 
Old 03-22-2006, 04:33 AM   #4
yewchong
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Hi,

Anyone knows as to how to retrieve created man pages through the man command? Currently, I have a formatted man page, but I do not know what to do in order to execute it.
I did man -M /path/to/mandir command
however the above command fails to work. Any advice please? Thanks!
 
Old 03-22-2006, 06:06 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,359
Blog Entries: 55

Rep: Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546
I tried the command: man /home/yewchong/sample.1 sample
However, I realised that this is in fact making man find both /home/yewchong/sample.1 and sample.

Try "man /home/yewchong/sample.1"
 
Old 03-22-2006, 06:17 AM   #6
yewchong
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Am afraid this might not be what I am looking for.

The situation is as such, I have a command "edit", "print", and I would like to document these two commands. Therefore I would like to make it such when I type "man edit", it looks for the edit command which I have documented, and man print will look for this command as well.

I have created a file called "man.1" where it contains both these commands (not sure if this is possible, or must it be 1 command 1 file). Therefore, what would be a correct approach to this problem? Sorry about it, as I am still rather new to linux. Thanks!
 
Old 03-22-2006, 05:21 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,359
Blog Entries: 55

Rep: Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546
OK. If you do "man -M ~ sample" your "sample.1" manpage should be in ~/man/man1, so make a minimal structure:
Code:
seq 0 9|xargs -iN mkdir -p man/manN
and move your page. If you don't want to keep supplying your path, either make a shell alias or copy /etc/man.config to your home and append the line
Code:
MANPATH<TAB>/home/username/man
where the rest of the MANPATH lines are. Notice you need to insert a tab at <TAB>, at least I did, else it wouldnt work.

I have created a file called "man.1" where it contains both these commands
The name isnt good. If the edit and print commands are linked to a custom application it's best to make it inherit the name of the app "myapp.1" and symlink to edit.1 and print.1.
 
Old 03-23-2006, 05:33 AM   #8
yewchong
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Original Poster
Rep: Reputation: 0
thanks a lot! =)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ man pages Guest1234 Linux - Newbie 2 06-29-2008 09:12 AM
C++ man pages Guest1234 Ubuntu 0 05-11-2005 02:45 AM
What do you mean by MAN pages? inspectreo Linux - Newbie 2 05-08-2005 02:12 PM
How do I know where the man pages are? narik Linux - General 1 06-15-2004 01:22 PM
man pages? southsibling Linux - Newbie 2 08-31-2003 11:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration