Skip to main content
Bounty Awarded with 100 reputation awarded by muru
added 9 characters in body
Source Link
Stéphane Chazelas
  • 584.6k
  • 96
  • 1.1k
  • 1.7k

-p was added to bash's declare in 2.0 released in 1996

-p was added to bash's declare in 2.0 in 1996

-p was added to bash's declare in 2.0 released in 1996

edited body
Source Link
Stéphane Chazelas
  • 584.6k
  • 96
  • 1.1k
  • 1.7k

But, in any case older versions did use "..." for quoting the value of scalar variables inside which ` and \ are special and those characters have an encoding that can be found as part of the encoding of other characters in some locales.

So, theThe output of declare -p is intended (as some comments in the code as well as statements from the maintainer on the mailing list suggest) if not documented to be reusable but in effect that's only (if at all) in the same version of the same bash shell and in the same locale on the same system (same libc and locale definitions).

A number of bugs (see this or this as examples) have been fixed in the past where the quoting was not done properly, or declare -p (or export -p which POSIX requires to output shell code suitable for reinput) alone was including definitions of variables from the environment that could not be mapped to shell variables.

But, in any case older versions did "..." for quoting the value of scalar variables inside which ` and \ are special and those characters have an encoding that can be found as part of the encoding of other characters in some locales.

So, the output of declare -p is intended (as some comments in the code as well as statements from the maintainer on the mailing list suggest) if not documented to be reusable but in effect that's only (if at all) in the same version of the same bash shell and in the same locale on the same system (same libc and locale definitions).

A number of bugs have been fixed in the past where the quoting was not done properly, or declare -p (or export -p which POSIX requires to output shell code suitable for reinput) alone was including definitions of variables from the environment that could not be mapped to shell variables.

But, in any case older versions did use "..." for quoting the value of scalar variables inside which ` and \ are special and those characters have an encoding that can be found as part of the encoding of other characters in some locales.

The output of declare -p is intended (as some comments in the code as well as statements from the maintainer on the mailing list suggest) if not documented to be reusable but in effect that's only (if at all) in the same version of the same bash shell and in the same locale on the same system (same libc and locale definitions).

A number of bugs (see this or this as examples) have been fixed in the past where the quoting was not done properly, or declare -p (or export -p which POSIX requires to output shell code suitable for reinput) alone was including definitions of variables from the environment that could not be mapped to shell variables.

added 71 characters in body
Source Link
Stéphane Chazelas
  • 584.6k
  • 96
  • 1.1k
  • 1.7k

So, the output of declare -p is only intended (as some comments in the code as well as statements from the maintainer on the mailing list suggest) if not documented to be reusable but in effect that's only (if at all) in the same version of the same bash shell and in the same locale on the same system (same libc and locale definitions).

Which dates the actual implementation on 1995-03-24, so after ksh93's but before ksh93 documenting it producing reusable output.

So, the output of declare -p is only intended (as some comments in the code as well as statements from the maintainer on the mailing list suggest) if not documented to be reusable but in effect that's only (if at all) in the same version of the same bash shell and in the same locale on the same system (same libc and locale definitions).

Which dates the actual implementation on 1995-03-24.

So, the output of declare -p is intended (as some comments in the code as well as statements from the maintainer on the mailing list suggest) if not documented to be reusable but in effect that's only (if at all) in the same version of the same bash shell and in the same locale on the same system (same libc and locale definitions).

Which dates the actual implementation on 1995-03-24, so after ksh93's but before ksh93 documenting it producing reusable output.

added 336 characters in body
Source Link
Stéphane Chazelas
  • 584.6k
  • 96
  • 1.1k
  • 1.7k
Loading
added 454 characters in body
Source Link
Stéphane Chazelas
  • 584.6k
  • 96
  • 1.1k
  • 1.7k
Loading
added 874 characters in body
Source Link
Stéphane Chazelas
  • 584.6k
  • 96
  • 1.1k
  • 1.7k
Loading
added 122 characters in body
Source Link
Stéphane Chazelas
  • 584.6k
  • 96
  • 1.1k
  • 1.7k
Loading
added 122 characters in body
Source Link
Stéphane Chazelas
  • 584.6k
  • 96
  • 1.1k
  • 1.7k
Loading
Source Link
Stéphane Chazelas
  • 584.6k
  • 96
  • 1.1k
  • 1.7k
Loading