shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] sub shell


From: Reinaldo Carvalho
Subject: Re: [shell-script] sub shell
Date: Fri, 25 Nov 2005 09:09:43 -0300

 Pipelines
       A pipeline is a sequence of one or more commands separated by
the character |. Each command in a pipeline is executed as a separate
process (i.e., in a subshell).

Command substitution and asynchronous commands are invoked in a
subshell environment that is a duplicate of the shell environment,
except that traps caught by the shell are reset to the values that the
shell inherited from its parent at invocation. Builtin commands that
are invoked as part of a pipeline are also executed in a subshell
environment. Changes made to the subshell environment cannot affect
the shell's execution environment.

      Compound commands and command sequences of the form `a ; b ; c'
are not handled gracefully when  process  suspension  is  attempted. 
When a process is stopped, the shell immediately executes the next
command in the sequence.
       It suffices to place the sequence of commands between
parentheses to force it  into  a  subshell,  which  may  be stopped as
a unit.


Uma explicação seria: "When a process is stopped, the shell
immediately executes the next command in the sequence.", com um
subshell isso não ocorre.



Em 25/11/05, Tiago Barcellos Peczenyj<address@hidden> escreveu:
> Andei cá pensando nos recentes problemas com variaveis e sub-shells e
> estou com uma duvida: por que o shell permite que sejam abertos
> sub-shells ?
>
> Não consigo uma utilidade pratica ao utilizar explicitamente um
> sub-shell, alguem pode me elucidar ?
>
> Obrigado
>
> Tiago
>
>
> ---------------------------------------------------------------------
> Esta lista não admite a abordagem de outras liguagens de programação, como 
> perl, C etc. Quem insistir em não seguir esta regra será moderado sem prévio 
> aviso.
> ---------------------------------------------------------------------
> Sair da lista: address@hidden
> ---------------------------------------------------------------------
> Esta lista é moderada de acordo com o previsto em 
> http://www.listas-discussao.cjb.net
> ---------------------------------------------------------------------
>
> Links do Yahoo! Grupos
>
>
>
>
>
>
>
>


--
Reinaldo Carvalho
Debian Sarge 3.1 - Linux User: #238310
Prodepa - address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]