process Span by shell


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers process Span by shell
# 1  
Old 06-16-2006
process Span by shell

is it possible to find which commnands make shell to Span a child process?

if so what is the determining criteria??

thanks
# 2  
Old 06-16-2006
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.
# 3  
Old 06-17-2006
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.
# 4  
Old 06-17-2006
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.
# 5  
Old 06-18-2006
yeah

I got it Man thanks for your time.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Combine logs span across multiple lines

Hi All, I am having a log file ERROR 2016-12-08 10:22:23.542 some data **** some data****** **** some data****** **** some data****** DEBUG 2016-12-08 10:23:23.542 some data **** some data****** **** some data****** **** some data****** when i grep the log file with ERROR am getting... (3 Replies)
Discussion started by: mohanalakshmi
3 Replies

2. Shell Programming and Scripting

select the lines in between some time span

Hi Everyone ! i want to take all the lines from a file that falls in between some date... and every line in a file has a time stamp.. ---some text---- 01/Jan/2010 ---- some other text ---- ---some text---- 10/Jan/2010 ---- some other text ---- ---some text---- 20/Dec/2010 ---- some... (3 Replies)
Discussion started by: me_newbie
3 Replies

3. UNIX for Dummies Questions & Answers

Extracting a Time Span from Syslog Messages File

Hi all, I need your help to explain how I can extract a time span from the syslog messages file on a Solaris 10 system. Here is an example extract of the syslog messages: Dec 4 11:51:38 hajap141-0107.nls.jlrint.com 267938: Dec 4 11:51:36: %DOT11-6-DISASSOC: Interface Dot11Radio0,... (4 Replies)
Discussion started by: wthomas
4 Replies

4. Filesystems, Disks and Memory

Life span of HDD - maximum reads/writes etc

Hi All I was wondering how the copying of vast amounts of data affected the overall lifespan of an HDD. In my example, I'm copying approx 120GB (250,000) of files, once per hour from disk to another. Is this likely to have a detrimental effect on the disk in terms of reads/writes etc? ... (2 Replies)
Discussion started by: huskie69
2 Replies

5. Shell Programming and Scripting

Shell Script to Kill Process(number of process) Unix/Solaris

Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it This is how we execute the script (and this is the requirement) ... (2 Replies)
Discussion started by: jonnyvic
2 Replies

6. UNIX for Advanced & Expert Users

Process accounting and Shell process time

Hi All, I am running the following accounting on one of my executable, $ accton /home/myexe-acct $ ./myexe $ accton When I check the process timings I get the below result, Shell process time: 300ms myexe time: 100ms I want to know on why the shell(sh) process is taking so much time... (1 Reply)
Discussion started by: santoshbr4
1 Replies

7. UNIX for Dummies Questions & Answers

Ubuntu Hardy: How to span windows over more than 1 screen?

Hi, Ive 3 screens, 2 nvidia graphiccards and all works fine with the nvidia binary driver and xinerama. I can maximize all windows an one screen, but now i need to span it over all 3 screens. Any ideas? thanks in advance. (3 Replies)
Discussion started by: mcW
3 Replies

8. AIX

How to ristrict tar to span multi volume of 1.95 gig each.

Can some one help me to know how I can restrict tar to span on multiple volumes if it get bigger then 2 gig. I am working on AIX 5.2 and created a tar of 4 gig but I want to move the tar to 4.3 that has limit of 2 gig. Thanks. (0 Replies)
Discussion started by: interim05
0 Replies

9. Shell Programming and Scripting

span of variable

Hi all, I am having a hard time in determining this. I have a shell script, in which I build a variable in a certain format (-i 'x x.in x.out' -i 'y y.in y.out' -i 'z z.in z.out) within a while loop. But that variable is getting lost if I read it after the while loop is ended. I tried "export"..,... (3 Replies)
Discussion started by: ttshell
3 Replies

10. Shell Programming and Scripting

Will cpio span tapes ?

Hi. I am very new to the unix world, although not to computers in general (i'm a DBA). We have some procedure here for backup files from the filesystem to tape, on which they chose cpio to back it up. What they do is similar to this: ls /dirname/ | cpio -ov -O/dev/ntape/tape0 But since files... (2 Replies)
Discussion started by: fidodido
2 Replies
Login or Register to Ask a Question