|
|
ru.perl- RU.PERL ---------------------------------------------------------------------- From : Vladimir Podgorny 2:5020/400 25 Apr 2002 21:53:59 To : Dmitry Suhodoev Subject : Re: как узнать код возврата запущенной программы -------------------------------------------------------------------------------- Dmitry Suhodoev <Dmitry.Suhodoev@f428.n550.z2.fidonet.org> wrote: > have a nice death, Hаpод _*/;/*_) > > сабж, то, что в шелле достигается с помощью "cmd && echo result funny"? Так же как и в шелле - $?. perldoc perlvar $CHILD_ERROR $? The status returned by the last pipe close, back- tick ("``") command, successful call to wait() or waitpid(), or from the system() operator. This is ^^^^^^^^ just the 16-bit status word returned by the wait() system call (or else is made up to look like it). Thus, the exit value of the subprocess is really ("$? >> 8"), and "$? & 127" gives which signal, if any, the process died from, and "$? & 128" reports whether there was a core dump. (Mnemonic: similar ^^^^^^^^^^^^^^^^^^ to sh and ksh.) ^^^^^^^^^^^^^^^ ... > -- > raVen, raven#fido,urc,ac,ru, http://raven.elk.ru/ -- VP992-RIPE --- ifmail v.2.15dev5 * Origin: Adamant ISP news server (2:5020/400) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.perl/12034323ad9f2.html, оценка из 5, голосов 10
|