Re: Returning a value to UNIX shell
Date: 1995/11/12
Message-ID: <4861pj$cl9_at_newsserver.trl.OZ.AU>#1/1
In article <1995Nov7.180816.29444_at_rossinc.com>, joelga_at_rossinc.com (Joel Garry) writes:
> SQL> select 5 foo from dual;
> WW
> FOO
> ----------
> 5
>
> SQL> exit _foo;
> You_at_wish:/usr/users/dontyou $ echo $status
> sh: status: parameter not set
>
Your problem above ^^^^^^^^^^^^^^^^^^^^ in sh
> (Now I try the csh:)
>
> wish:/usr/users/dontyou
> 12 % sqlplus You/thinkIwouldtell
>
> SQL> column foo new_value _foo;
> SQL> select 5 foo from dual;
>
> FOO
> ----------
> 5
>
> SQL> exit _foo;
>
> wish:/usr/users/dontyou
> 13 % echo $status
> 5
>
> Seems to only work in csh... not something I would recommend for
> production scripts.
That is because you probably are confused with the difference between sh and csh.
Use:
1. $? for sh and ksh 2. $status for $status
ta
tony
-- _____ ________ / ___ |Tony Jambu, Database Consultant /_ _ /_ __ / |Wizard Consulting,Aust (ACN 065934778) /(_)/ )(_/ \_/(///(/_)/_( |CIS: 100250.2003_at_compuserve.com FAX: +61-3-4163559 \_______/ |EMAIL:TJambu_at_wizard.com.au PHONE: +61-3-4122905Received on Sun Nov 12 1995 - 00:00:00 CET