Welcome to the new Linux Foundation Forum!

how does shell invoke a process?

How does Shell invoke a process, when an application is executed? If I do not run any command, is any IDLE thread running?

Comments

  • atreyuatreyu Posts: 216
    gr8linux wrote:
    How does Shell invoke a process, when an application is executed?
    Er, that's a little vague. Can you be more specific?
    If I do not run any command, is any IDLE thread running?
    If by IDLE thread, you mean a process pertaining to your shell, then yes. The shell process itself is running. E.g., on my box:
    [[email protected] ~]$ ps -fwwu $USER
    UID        PID  PPID  C STIME TTY          TIME CMD
    joeblow    16405 16404  4 00:31 pts/2    00:00:00 -tcsh
    joeblow    16422 16405  0 00:31 pts/2    00:00:00 ps -fwwu joeblow
    
    The output of this ps command shows all running process that are owned by user "joeblow". The shell (tcsh) and the ps command itself are the only two processes joeblow is running, though the ps command will have already disappeared, of course. The shell is using PID (Process ID) 16405. Notice that the PPID (Parent PID) of the ps command is the PID of the tcsh shell.

    You can also use the tty command to see the filename of the terminal that your shell is using to connect to STDIN:
    [[email protected] ~]$ tty
    /dev/pts/2
    
    which correlates to the pts/2 in the TTY column of the ps output above.
Sign In or Register to comment.