[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "unset" return value wrong

From: Stephen Gildea
Subject: Re: "unset" return value wrong
Date: Wed, 18 Oct 2000 18:22:03 EDT

>       Unsetting a variable or function that was not previously set
>       shall not be considered an error and shall not cause the shell
>       to abort.
>   I contend that this actually refers to the text at the beginning of
>   section 3.14, which says that the shell shall abort if a syntax error
>   is encountered in any of the special builtin utilities.

I'm not sure about this.  Even if unsetting an unset variable were an
error, it would not be a syntax error, so applying 3.14 seems a bit of
a stretch.  But I'll bow to your greater shell experience here.

I don't have POSIX.2 in front of me now, so let me quote the Single
UNIX Specification, version 2, issue 5, which was based on POSIX.2,
I think.  It says "Read-only variables cannot be unset," and later
that the exit status is non-0 if "At least one name could not be unset."

So putting those two together, I thought that the only error possible
was attempting to unset a read-only variable.

 < Stephen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]