[X-Unix] Console in a Subshell?
Eugene
list-themacintoshguy at fsck.net
Fri Aug 17 06:29:32 PDT 2007
On Thu, Aug 16, 2007 at 09:08:49PM CDT, Eric F Crist <ecrist at secure-computing.net> wrote:
>
> On Aug 16, 2007, at 6:24 PMAug 16, 2007, Jerry Krinock wrote:
>>
>> On 2007 Aug, 16, at 15:32, Brian Medley wrote:
>>
>>> You're capturing output. If youw ant the return value do
>>> something like:
>>>
>>> perlscript.pl arg1 arg2
>>> echo $?
>>
>> Thank you, Brian. Makes sense and works. I didn't know that bash had
>> handy built-in variables like perl does. It's kind of hard to Google for
>> documenation on "?", but apparently "?" is in bash like "_" is in perl.
>> Very handy.
>
> AFAIK, that's pretty standard among almost all shells and scripting
> languages.
Also, I did a Google search on "bash return value". The first hit,
"BASH Programming - Introduction HOW-TO: Misc", had this to say:
In bash, the return value of a program is stored in a special
variable called $?. This illustrates how to capture the return
value of a program, ...
--
Eugene
http://www.coxar.pwp.blueyonder.co.uk/
More information about the X-Unix
mailing list