Re: Need help for bash function return value

2012-10-12 Thread Greg Wooledge
On Thu, Oct 11, 2012 at 08:01:40PM -0700, Tinni wrote: > I am very new to the shell scripting.. Need some pointers for getting the > return value in shell scripting. "Return value" is an integer from 0 to 255. That's not what you want. > I want the values ( db_host_user, db_host, ORACLE_SID)

Re: Need help for bash function return value

2012-10-12 Thread Allodoxaphobia
On Thu, 11 Oct 2012 20:01:40 -0700 (PDT), Tinni wrote: > > I am very new to the shell scripting.. Need some pointers for getting > the return value in shell scripting. comp.unix.shell

bug-bash@gnu.org

2012-10-12 Thread Sergey Fadeev
Why doesn't it exit the shell? $ set -e $ echo $(false) Shouldn't the error code of $(false) command substitution be checked by set -e before passing stdout to the echo builtin? Isn't it the most logical behavior that most people would expect of set -e? Bash version: GNU bash, version 4.2.24(

bug-bash@gnu.org

2012-10-12 Thread Greg Wooledge
On Fri, Oct 12, 2012 at 06:55:28AM -0400, Sergey Fadeev wrote: > Why doesn't it exit the shell? > $ set -e > $ echo $(false) Because the exit status of echo is 0.

bug-bash@gnu.org

2012-10-12 Thread Steven W. Orr
On 10/12/12 06:55, quoth Sergey Fadeev: Why doesn't it exit the shell? $ set -e $ echo $(false) Shouldn't the error code of $(false) command substitution be checked by set -e before passing stdout to the echo builtin? Isn't it the most logical behavior that most people would expect of se

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-12 Thread Chet Ramey
On 10/10/12 10:38 AM, Wladimir Sidorenko wrote: > Dear all, > > After running the following command: > > $ ! test 0 -eq 0 > > I can see different exit codes in $? and ${PIPESTATUS[@]}. Here, what I get > > $ ! test 1 -eq 0 ; echo $? ${PIPESTATUS[@]} > 0 1 > > $ ! test 0 -eq 0 ; echo $? ${PIPE

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-12 Thread Wladimir Sidorenko
Ok, thanks. I'll notice this for the future. It's of course arguable, whether PIPESTATUS stores a true value, since the '!' inversion keyword gets ignored in this case. But if it was intended, than it's ok. 2012/10/13 Chet Ramey : > On 10/10/12 10:38 AM, Wladimir Sidorenko wrote: >> Dear all, >> >

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-12 Thread Eric Blake
On 10/12/2012 03:36 PM, Wladimir Sidorenko wrote: > Ok, thanks. I'll notice this for the future. It's of course arguable, > whether PIPESTATUS stores a true value, since the '!' inversion > keyword gets ignored in this case. But if it was intended, than it's > ok. Consider: $ f() { return 2; } $