A NOTE has been added to this issue. ====================================================================== https://www.austingroupbugs.net/view.php?id=1561 ====================================================================== Reported By: calestyo Assigned To: ====================================================================== Project: Issue 8 drafts Issue ID: 1561 Category: Shell and Utilities Type: Enhancement Request Severity: Editorial Priority: normal Status: New Name: Christoph Anton Mitterer Organization: User Reference: Section: various Page Number: N/A Line Number: N/A Final Accepted Text: ====================================================================== Date Submitted: 2022-02-01 00:10 UTC Last Modified: 2022-02-02 15:15 UTC ====================================================================== Summary: clarify what kind of data shell variables need to be able to hold ======================================================================
---------------------------------------------------------------------- (0005652) chet_ramey (reporter) - 2022-02-02 15:15 https://www.austingroupbugs.net/view.php?id=1561#c5652 ---------------------------------------------------------------------- Re: https://www.austingroupbugs.net/view.php?id=1561#c5650 Bash supports both old and newer behavior wrt environment strings. If an environment string doesn't contain `=' or starts with `=' (no name), bash skips it (way, way back in the day, such strings would cause some applications -- notably `sh' -- to seg fault). An environment string that contains an `=', doesn't follow the naming rules for an exported shell function, but has a name that is not a valid shell variable name, gets passed to child processes in their environment but otherwise ignored. Bash doesn't export or import array variables. There is code in there to do it, just commented out. It encodes the value as a compound variable assignment, similar to the output of `declare -p'. I've never released a version of bash with that code enabled. One of the concerns has been distinguishing it from a scalar variable with value `( some list of words )'. There aren't any shells that export arrays as arrays. ksh93 and mksh export element 0 as a scalar variable. yash exports the values as a colon-separated list, but doesn't import the variable as an array. bash and zsh don't allow it. Bash does export and import shell functions, encoding the names in a way that allows the shell to recognize them as functions. Issue History Date Modified Username Field Change ====================================================================== 2022-02-01 00:10 calestyo New Issue 2022-02-01 00:10 calestyo Name => Christoph Anton Mitterer 2022-02-01 00:10 calestyo Section => various 2022-02-01 00:10 calestyo Page Number => N/A 2022-02-01 00:10 calestyo Line Number => N/A 2022-02-01 19:33 mirabilos Note Added: 0005645 2022-02-01 19:44 calestyo Note Added: 0005647 2022-02-01 20:52 chet_ramey Note Added: 0005649 2022-02-01 23:07 kre Note Added: 0005650 2022-02-02 15:15 chet_ramey Note Added: 0005652 ======================================================================
