LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Distingush between internal and external command (https://www.linuxquestions.org/questions/linux-newbie-8/distingush-between-internal-and-external-command-631421/)

dina3e 03-29-2008 12:58 AM

Distingush between internal and external command
 
i am very much confussing which is internal command and which is external command in linux system.
and where both the command resides in the system..

Tinkster 03-29-2008 01:25 AM

"internal command" most commonly means "built-into bash".
External are ones that aren't part of bash. E.g. echo.

There's a bash-built-in echo which will be used by default.
If you want to use the stand-alone one, use with the fully
qualified path, e.g. /bin/echo


Cheers,
Tink

dina3e 03-31-2008 08:41 PM

Quote:

Originally Posted by Tinkster (Post 3103782)
"internal command" most commonly means "built-into bash".
External are ones that aren't part of bash. E.g. echo.

There's a bash-built-in echo which will be used by default.
If you want to use the stand-alone one, use with the fully
qualified path, e.g. /bin/echo


Cheers,
Tink

can u go beyond that what exactly the shell does when it face incase of internal and external command.
also i want to distigush the command at a glance can any way???

chrism01 03-31-2008 08:51 PM

The shell will default to using the built-in, if it has one and you have not explicitly specified the external one.
There's no way to tell 'at a glance' but you could read the man pages/web eg
http://www.tldp.org/LDP/abs/html/
and you could use the 'find' cmd to see if there's an external (aka standalone) version of any cmd.

A similar case (this is actually to do with the PATH env var) is in crontab entries.
The cron daemon has a minimal env, so if you call a cmd that is not built-in, it will most likely not work unless:

1. you specify the complete/absolute path eg

OR

2. you have exported the cmd path into the env for your script.


All times are GMT -5. The time now is 05:01 PM.