![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell Script Dependencies other process | pankajkrmishra | Shell Programming and Scripting | 4 | 07-25-2006 06:20 AM |
| How to ristrict tar to span multi volume of 1.95 gig each. | interim05 | AIX | 0 | 06-19-2006 01:36 PM |
| span of variable | ttshell | Shell Programming and Scripting | 3 | 01-24-2006 02:16 PM |
| Will cpio span tapes ? | fidodido | Shell Programming and Scripting | 2 | 01-11-2006 08:42 AM |
| shell programming for process? | robocup | Shell Programming and Scripting | 1 | 07-30-2005 09:35 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
This is a little more complicated than a post can deal with very well. Let's use the Korn shell -- /bin/ksh as an example. When you have in your script: Code:
echo "hi there" The "echo" is a command. Most commands invoke external programs. When a command runs as a program it creates a separate process - "spawn". Not all commands are separate processes. The type command in ksh will tell you what the command is - whehter it is a shell builtin, an external program, etc. Code:
vcspnm:/home/jmcnama> type echo echo is a shell builtin vcspnm:/home/jmcnama> type ls ls is a tracked alias for /usr/bin/ls vcspnm:/home/jmcnama> type while while is a keyword vcspnm:/home/jmcnama> type lp lp is /usr/bin/lp So: lp and ls are programs, while and echo are part of the shell. If type tells you it is a builtin then no separate process is created. Same for a keyword like while or if. The flip side of this is that you can force the shell to make a separate process: Code:
echo "stuff " > somefile & wait This forces command to run in a separate process, even if it would normally not do so. |
|
||||
|
thanks
thank you man
you mean commnads are programs which will be "excecuted" upon invoking them so these programs must be the "Source code" which will be compiled and executed just like any other user progrmas when the commnad is invoked. if I am wrong I seek your advice. |
|
||||
|
No. ls is a command - it points to an already compiled ready-to-run program /usr/bin/ls In order to run the ls program the shell creates a separate process.
Not all commands are separate programs. The type command tells you what flavor each command is - knowing that you then know if the command will make a separate process or not. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|