Pipes and Filters

E-mail Imprimir PDF

 

Sob o bash, você pode criar uma seqüência de um ou mais comandos separados por um dos seguintes operadores:

Operator Syntax Description Example
 ; command1; command2 Separates commands that are executed in sequence. In this example, pwd is executed only after date command completes.
date ; pwd
 
& command arg & The shell executes the command in the background in a subshell. The shell does not wait for the command to finish, and the return status is 0. The & operator runs the command in background while freeing up your terminal for other work. In this example, find command is executed in background while freeing up your shell prompt.
find / -iname "*.pdf" >/tmp/output.txt &
 
&& command1 && command2 command2 is executed if, and only if, command1 returns an exit status of zero i.e. command2 only runs if first command1 run successfully.
[ ! -d /backup ] && mkdir -p /backup
 See Logical AND section for examples.
|| command1 || command2 command2 is executed if and only if command1 returns a non-zero exit status i.e. command2 only runs if first command fails.
tar cvf /dev/st0 /home || mail -s 'Backup failed' you@example.com </dev/null
 See Logical OR section for examples.
| command1 | command2 Linux shell pipes join the standard output of command1 to the standard input of command2. In this example, output of the ps command is provided as the standard input to the grep command
ps aux | grep httpd
Última atualização ( Sáb, 18 de Junho de 2011 16:25 )  

Adicionar comentário


Código de segurança
Atualizar

sideBar



Categorias

Arquivo

mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterHoje12
mod_vvisit_counterOntem362
mod_vvisit_counterSemana12
mod_vvisit_counterSemana Anterior2990
mod_vvisit_counterMês4076
mod_vvisit_counterMês Anterior578
mod_vvisit_counterTotal181139

We have: 3 guests, 1 bots online
Seu IP: 38.107.179.244
 , 
Agora: Mai 21, 2012 Mai
Membros : 17
Conteúdo : 155
Visualizações de Conteúdo : 37909


Joomla Clube

Joomla Brasil

Info Wester

IdgNow

BrLinux.org

Joomla Brasislia

Joomla.org

F13 -Tecnologia

Dicas Linux

Olhar Digital

Joomla Facil

Linux Security

Debian.org

Viva o Linux

Ubuntu-BR