The UNIX and Linux Forums  


Go Back   O UNIX e Linux Forum > Top Fóruns > Programação Shell Script e
.
google unix.com



Programação Shell Script e Post perguntas sobre ksh, CSH, SH, BASH, Perl, PHP, SED, Awk e outros scripts shell e shell scripts línguas aqui.

Mais UNIX e Linux Fórum Tópicos Você pode achar Helpfull
Fio Thread Starter Fórum Respostas Última postagem
Terminal e Cron Job Retorno Diferentes Código de status isaac_ho Programação Shell Script e 1 06-02-2008 01:12
Retorno do estado SAÍDA ($?) Zingaro HP-UX 1 03-12-2008 07:07
Retorno do estado de todas as anteriores é executado mpang_ Programação Shell Script e 4 06-27-2006 03:58
retorno ftp estatuto blt123 Programação Shell Script e 12 07-21-2005 06:48
Retornar estado ... Shaz Programação Shell Script e 7 11-19-2002 06:35

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
Linkback Thread Tools Pesquisar este Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-28-2006
new2ss new2ss is offline
Usuário
  
 

Join Date: Jan 2006
Lugares: 133
Verifique scp retorno estatuto

Oi todos

abaixo está um trecho do meu perl código
Código:
system ("scp -pq  $dest_file $path");
Como eu posso aprisionar o status de retorno? isto é, se o scp não Como eu posso saber?
  #2 (permalink)  
Old 06-28-2006
blowtorch's Avatar
maçarico blowtorch is offline Forum Advisor  
Adepto
  
 

Join Data: dezembro 2004
Local: Singapura
Posts: 2.350
Do perl 5,8 homem página:
Código HTML:
 The return value is the exit status of the program
             as returned by the "wait" call.  To get the actual
             exit value shift right by eight (see below).  See
             also "exec".  This is not what you want to use to
             capture the output from a command, for that you
             should use merely backticks or "qx//", as described
             in "`STRING`" in perlop.  Return value of -1
             indicates a failure to start the program (inspect $!
             for the reason).

             Like "exec", "system" allows you to lie to a program
             about its name if you use the "system PROGRAM LIST"
             syntax.  Again, see "exec".

             Because "system" and backticks block "SIGINT" and
             "SIGQUIT", killing the program they're running
             doesn't actually interrupt your program.

                 @args = ("command", "arg1", "arg2");
                 system(@args) == 0
                      or die "system @args failed: $?"

             You can check all the failure possibilities by
             inspecting $? like this:

                 $exit_value  = $? >> 8;
                 $signal_num  = $? & 127;
                 $dumped_core = $? & 128;

             or more portably by using the W*() calls of the
             POSIX extension; see perlport for more information.
Verifique o perlfunc página man para mais informações. O homem perlfunc página pode ser acessada através da fixação das MANPATH incluir o "<perl_install_dir> / homem" diretório.
  #3 (permalink)  
Old 06-28-2006
new2ss new2ss is offline
Usuário
  
 

Join Date: Jan 2006
Lugares: 133
Oi,
não significa que eu deveria fazer um
Código:
 if ($? = -1) print $! ;# to output error message
else print "success"
Tentei o exposto, e tenho algo como "$! \u003d Ioctl inapropriado para dispositivo".
Eu uso $? indevidamente?

Oi maçarico, i dada meu código, e isso worked.thanks um lote
Código:
$exit_value  = $? >> 8;
if ($exit_value != 0) 
	{print "Sending of file NO\n";}
	else 
	{print "Sending of file DONE\n";}

Última edição por new2ss; em 06/29/2006 01:29..
Closed Thread

Marcadores

Tags
ioctl inapropriado para dispositivo, perl, perl turnos, deslocar, turnos perl

Thread Tools Pesquisar este Thread
Pesquisar este Thread:

Pesquisa Avançada
Display Modes Esta taxa Thread
Esta taxa Thread:

Destacamento Regimento
Você não pode postar novas threads
Você não pode postar respostas
Você não pode postar anexos
Você não pode editar suas postagens

BB code é Ligado
Smilies são Ligado
[IMG] código é Ligado
Código HTML é Desligado
Trackbacks são Ligado
Pingbacks são Ligado
Refbacks são Ligado




Todos os horários são GMT -4. A hora é agora 04:16.


Powered by: vBulletinCopyright © 2000 - 2006, Jelsoft Enterprises Limited. Língua Traduções Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
O UNIX e Linux Fóruns Content Copyright © 1993-2009. Todos os Direitos Reserved.Ad Gestão por RedTyger

Content Relevant URLs por vBSEO 3.2.0