LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-19-2009, 07:33 AM   #1
tianlijian
LQ Newbie
 
Registered: Mar 2007
Posts: 27

Rep: Reputation: 15
does the `( )' create a subshell?


does the `( )' create a subshell? if so, in `( ps )' command, why i can not see the subsell?
 
Old 04-19-2009, 08:39 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
I don't know. It works for me.

Code:
david:~$ ps
  PID TTY          TIME CMD
 3565 pts/1    00:00:00 bash
24991 pts/1    00:00:00 ps
david:~$

david:~$ (while [ 1 ]; do   echo "Subshell running"; done; )
Subshell running
Subshell running
Subshell running
Subshell running
Subshell running
Subshell running
Subshell running
Subshell running
...
<crtl+z to suspend process>

[1]+  Stopped                 ( while [ 1 ]; do
    echo "Subshell running";
done )

david:~$ ps
  PID TTY          TIME CMD
 3565 pts/1    00:00:00 bash
24993 pts/1    00:00:00 bash
24995 pts/1    00:00:00 ps
david:~$
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute commands within a subshell opened by another command? plin Programming 3 02-11-2008 09:19 AM
Help, with subshell I think? :S DjRakso Linux - Newbie 3 10-28-2007 04:24 PM
tcsh How to execute foreach in subshell? kaz2100 Programming 1 07-07-2007 08:10 AM
mc subshell.c: read (subshell_pty...): rickenbacherus Linux - Software 2 07-14-2004 08:14 PM
Continuing a script on a new subshell dpillay Programming 2 05-29-2004 08:26 PM


All times are GMT -5. The time now is 01:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration