Re: dash unset idiosyncrasies

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

 



Parke schreef op 06-07-15 om 04:18:
> The man page does not say what happens if the given name corresponds
> only to a function.

Neither does POSIX, as you've found out: "[...] if a variable by that
name does not exist, it is unspecified whether a function by that name,
if any, shall be unset." I agree the dash man page could do with
clarifying this.

I've found it best, to avoid bugs and confusion, to always use 'unset'
with either the -v or the -f option (but not both). This should work
consistently on all POSIXly shells.

FYI, other shells produce similar output for your test script (except
AT&T ksh halts execution on 'unset' without parameters.) There seem to
be no shells that support unsetting both variables and functions with a
single 'unset' command.

- Martijn

--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux