From 0f5e670cde5f844680a20f986786249dfe983584 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Mon, 24 Oct 2016 07:14:39 -0700 Subject: "typeset -p" uses "export" commands or the "-g" option for parameters that are not local to the current scope --- Test/B02typeset.ztst | 4 ++-- Test/B03print.ztst | 4 ++-- Test/V10private.ztst | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'Test') diff --git a/Test/B02typeset.ztst b/Test/B02typeset.ztst index d6d24210b..6d85a63fe 100644 --- a/Test/B02typeset.ztst +++ b/Test/B02typeset.ztst @@ -454,7 +454,7 @@ fn() { typeset -p array nonexistent; } fn 1:declare -p shouldn't create scoped values ->typeset -a array=( foo bar ) +>typeset -g -a array=( foo bar ) ?fn:typeset: no such variable: nonexistent unsetopt typesetsilent @@ -490,7 +490,7 @@ ?0 ?(eval):5: read-only variable: pbro ?(eval):6: read-only variable: pbro -?typeset -r pbro +?typeset -g -r pbro ?0 ?(eval):10: read-only variable: pbro diff --git a/Test/B03print.ztst b/Test/B03print.ztst index befe2f2dd..a4431cbc8 100644 --- a/Test/B03print.ztst +++ b/Test/B03print.ztst @@ -308,5 +308,5 @@ printf -v foo "%s\0%s-" into the breach typeset -p foo 0:print and printf into a variable ->typeset foo='once more' ->typeset foo=$'into\C-@the-breach\C-@-' +>typeset -g foo='once more' +>typeset -g foo=$'into\C-@the-breach\C-@-' diff --git a/Test/V10private.ztst b/Test/V10private.ztst index 320e35764..7ebf5a87f 100644 --- a/Test/V10private.ztst +++ b/Test/V10private.ztst @@ -129,7 +129,7 @@ 0:private hides value from surrounding scope in nested scope >typeset -a hash_test=( top level ) >typeset -A hash_test=( in function ) ->typeset -a hash_test=( top level ) +>typeset -g -a hash_test=( top level ) >array-local top level >top level F:note "typeset" rather than "private" in output from outer -- cgit 1.4.1