[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ast-users
Subject:    Re: RE: [ast-users] How to retrieve result code of command
From:       David Korn <dgk () research ! att ! com>
Date:       2010-03-12 17:34:17
Message-ID: 201003121734.o2CHYHxf023762 () penguin ! research ! att ! com
[Download RAW message or body]

Subject: Re: RE: [ast-users] How to retrieve result code of command substitution  in	assignment?
--------


> Date: Fri, 12 Mar 2010 17:29:44 +0100
> From: heiner.steven@nexgo.de
> To: ast-users@research.att.com
> Subject: [ast-users] How to retrieve result code of command substitution in	as
signment?
> 
> Hello,
> 
> how could I (in a reliable, portable way) retrieve the exit code of
> the program "urldecode" in the following code fragment:
> 
>      var=$(echo "$url" | urldecode)
> 
> Tests show that the result of the assignment is the result of the
> pipeline started for command substition (here: the exit code of
> "urldecode"). But is this something to depend upon, or is it
> an implementation detail?


This is defined in section 2.9.1 of the standard.

      var=$(echo "$url" | urldecode)

is a simple command.

The last paragraph of this section states:

"If there is no command name, but the command contained a command substitution,
the command shall complete with the exit status of the last command performed."

David Korn
dgk@research.att.com
_______________________________________________
ast-users mailing list
ast-users@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic