LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-10-2005, 06:06 AM   #1
learnfast
Member
 
Registered: Mar 2005
Location: berlin
Distribution: Redhat 9, Fedora 3
Posts: 70

Rep: Reputation: 15
learned "aliases", what are "functions" in .bashrc?


I just learned how to set up an alias for a specific user
by adding the alias to this file:

/home/user1/.bashrc

However, I also saw in the file that there is a section comment
which says "aliases and functions". What are functions in this
sense, how do I create them and what do they do? Are these
somehow functions, e.g. written in perl or c that I can call from
the command line?

Thanks.
 
Old 03-10-2005, 07:21 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
They are bash functions.
From info:bash -
Functions are declared using this syntax:
[ `function' ] NAME () { COMMAND-LIST; }

Type in 'info:bash' in the konqueror web browser, or the application launcher and go to the section 'basic shell features' for details. Unless you prefer 'info bash' in the console.
 
Old 03-10-2005, 07:28 AM   #3
learnfast
Member
 
Registered: Mar 2005
Location: berlin
Distribution: Redhat 9, Fedora 3
Posts: 70

Original Poster
Rep: Reputation: 15
thanks...

what is the difference actually between "info bash" and "man bash"
they seem to have different information
i wasn't aware of "info ..."
is that new? I used unix back in 1992 the last time and we always used "man ..."

thanks.
 
Old 03-15-2005, 04:24 AM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
info provides an indexed manual. Some of the man pages are not maintained while the info pages are. The man pages deal with the syntax and are more concise. 'info bash' provides a book full of information.

They are produced differently. The info pages are produced from docbook-utils. The source can be converted to different types of documents, such as info texinfo files, html pages or pdf documents. Man pages use Troff source files.

Another way to view man pages is to use the -Tdvi or -t or -Tps options. They will produce a .dvi or .ps printable document that you can view in kdvi or kghostview respectively. For some of the man pages, you may find it worthwhile to print them out. Such as coreutils and bash.

p.s.
On recent Mandrake (10.1 CE and up) the -T option is no longer available. I don't know about red hat or fedore core.

Last edited by jschiwal; 03-15-2005 at 04:25 AM.
 
  


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
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 6 03-21-2013 10:35 AM
what is "sticky bit mode" , "SUID" , "SGID" augustus123 Linux - General 10 08-03-2012 04:40 AM
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
"ifcfg-ethx" and "network-functions" files peok Linux - Networking 12 08-13-2003 06:06 PM


All times are GMT -5. The time now is 09:36 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration