Bash Version: 4.3 Patch Level: 42 Description: `alias' does not `--'-ize alias items with a name starting with a `-' when it is invoked to print aliases in the reusable form. This causes `invalid option' errors when trying to reuse these output.
Steps to Reproduce:
Run the following segment:
( unalias -a
alias -- -a=
alias
eval "$(alias)" )
An `invalid option' error will popup at the final `eval'.
Fix:
Always stick a `--' into the reusable form:
diff -Naurt bash_/builtins/alias.def bash2/builtins/alias.def
--- bash_/builtins/alias.def 2015-12-09 23:07:42.885174694 -0500
+++ bash2/builtins/alias.def 2015-12-09 23:07:18.681163414 -0500
@@ -232,7 +232,7 @@
value = sh_single_quote (alias->value);
if (flags & AL_REUSABLE)
- printf ("alias ");
+ printf ("alias -- ");
printf ("%s=%s\n", alias->name, value);
free (value);
--
Regards,
Arthur2e5
signature.asc
Description: OpenPGP digital signature
