Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Significance of different shells? Post 302838901 by Corona688 on Tuesday 30th of July 2013 06:55:43 PM
Old 07-30-2013
Quote:
Originally Posted by syregnar86
What constitutes internal commands from external commands?
Nothing tricky about it. External commands are external because they're external -- they're files, programs the shell runs. They exist whether you're running a shell or not. cd is a pure builtin, without any external equivalent -- by definition cd must be a builtin, it wouldn't work.

ls on the other hand is not a builtin -- it has binary executables and manual pages and stuff.

printf is both -- it is a builtin in most shells, for performance reasons since it's used often for tiny tasks. But the binary program also exists in case it's needed.

Code:
$ whereis cd
cd:

$ whereis ls
ls: /bin/ls /usr/share/man/man1/ls.1.bz2 /usr/share/man/man1p/ls.1p.bz2

$ whereis printf
printf: /usr/bin/printf /usr/include/printf.h /usr/share/man/man3/printf.3.bz2 /usr/share/man/man1/printf.1.bz2 /usr/share/man/man1p/printf.1p.bz2 /usr/share/man/man3p/printf.3p.bz2

$

An extreme case is the busybox shell, which is intended to be a mini stand-alone UNIX system. It may have hundreds of builtins, including minimal versions of things like awk, sed, cp, mv, xargs, etc etc etc -- which traditionally have never been builtins.

So, the reason all these programs seem identical between shells is because your shell doesn't contain the universe, just talks to it.
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

what the significance of ~

what does this symbol ~ represent in unix for example.... If i create directories called personal and lab and lab5 and the command chmod 776~/lab5 is issued. What results would i expect to get. basically i know that chmod 776 would prevent others from executing the files in the directory but... (2 Replies)
Discussion started by: BigTool4u2
2 Replies

2. Shell Programming and Scripting

what is the significance of braces and spaces???

Hi , i have few doubts about the braces and spaces which are quite often used: for instance: when i try the belo command it will not work export variable= cat filename rather when i try the cat command without any space it works fine export variable=cat filename and... (3 Replies)
Discussion started by: ahmedwaseem2000
3 Replies

3. Shell Programming and Scripting

What is the significance of . / ?

Many scripts are executed in the following way. . /scriptname Even when the file does not have execute permission, it can be executed this way. How does this work? (6 Replies)
Discussion started by: krishmaths
6 Replies

4. UNIX for Dummies Questions & Answers

significance of statement

Hi, I am a newbie in unix shell scripting and I am trying to understand the result of the following line : ls -l $1*$4*ready I understand the ls-l but the rest is just really confusing. Any help would be appreciated. TIA (3 Replies)
Discussion started by: nickcarter
3 Replies

5. Solaris

significance of library locations in solaris8...please help

this post is related to the arrangements of libraries in a solaris-8 distribution. i want to build external packages on solaris-8 i need to know why libraries are scattered in a solaris distribution among different below mentioned directories, please tell me whats the importance ?? /lib... (3 Replies)
Discussion started by: mobydick
3 Replies

6. AIX

Group significance in mkrole aix 5.3

Hello... I am getting ready to create a bunch of groups for several of our servers all of which are running Aix 5.3. We really want to keep people away from using the root login and as such the systems have been hardened using aixpert and if it is absolutely needed people must su -. There are... (1 Reply)
Discussion started by: dgaixsysadm
1 Replies

7. Shell Programming and Scripting

Significance of '{}' \;

What is the Significance of '{}' \; in UNIX? (2 Replies)
Discussion started by: Shell_Learner
2 Replies

8. Shell Programming and Scripting

Significance of forward slash(/) while specifying a directory

What is the significance of the forward slash(/) while specifying a directory? cp -av /dir/ /opt/ and cp -av /dir /opt Does effectively the same job it seems? (2 Replies)
Discussion started by: proactiveaditya
2 Replies

9. Solaris

significance of pfiles

What is the significance of pfiles? What is the use of it and how and where to use it?:wall: (2 Replies)
Discussion started by: varunksharma87
2 Replies

10. Shell Programming and Scripting

Significance of ':-' while accessing a variable

Hi I was trying to understand what ':-' means when used with variables echo ${x:-10} if Thanks (4 Replies)
Discussion started by: zulfi123786
4 Replies
WHICHMAN(1)						      General Commands Manual						       WHICHMAN(1)

NAME
whichman - show the location of a man page using a fault tolerant approximate matching algorithm SYNOPSIS
whichman [-#ehIp][-t#] man-page-name DESCRIPTION
whichman is a "which" alike search command for man pages. whichman searches the MANPATH environment variable. If this variable is not defined, then it uses /usr/share/man:/usr/man:/usr/X11R6/man: /usr/local/share/man:/usr/local/man by default. Unlike "which" this program does not stop on the first match. The name should probably have been something like whereman as this is not a "which" at all. whichman shows all man-pages that match and allows you to identify the different sections to which the pages belong. whichman can handle international manpage path names for different languages. Man pages in different languages may be stored in .../man/<country_code>/man[1-9]/... By default, whichman does fault tolerant approximate string matching. With a default tolerance level of: (strlen(searchpattern) - number of wildcards)/6 + 1 OPTIONS
-h Prints a little help/usage information. -I Do case sensitive search (default is case in-sensitive) -e Use exact matching when searching for a given man-page and the wildcards * and ? are disabled. -p print the actual tolerance level in front of the man page name. -# or -t# Set the fault tolerance level to #. The fault tolerance level is a integer # in the range 0-255. It specifies the maximum number of errors permitted in finding the approximate match. A tolerance_level of zero allows exact matches only but does NOT disable the wildcards * and ?. The search key may contain the wildcards * and ? (but see -e option): '*' any arbitrary number of character '?' one character The last argument to whichman is not parsed for options as the program needs at least one man-page-name argument. This means that whichman -x will not complain about a wrong option but search for the man-page named -x. EXAMPLE
whichman print This will e.g. find the man-pages: /usr/share/man/man1/printf.1.gz /usr/share/man/man3/printf.3.gz /usr/share/man/man3/rint.3.gz BUGS
The wildcards '?' and '*' can not be escaped. These characters function always as wildcards. This is however not a big problem since there is hardly any man-page that has these characters in its name. AUTHOR
Guido Socher (guido@linuxfocus.org) SEE ALSO
ftff(1), man(1) Search utilities April 1998 WHICHMAN(1)
All times are GMT -4. The time now is 05:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy