blob: 3845f76acb1629ef909e5782d7d14dfa5e03e5aa [file] [log] [blame]
Denys Vlasenko38ef39a2017-07-18 01:40:01 +02001readonly a=A
2b=B
3readonly b
4# readonly on already readonly var is harmless
5readonly b a
6readonly | grep '^readonly [ab]='
7# this should work
8export a b
9export -n a b
10echo Ok:$?
11env | grep -e^a= -e^b= # shows nothing
12
13# these should all fail (despite the same value being assigned)
14# bash does not abort even in non-interactive more (in script)
15true
16a=A
17echo Fail:$?; true
18readonly a=A
19echo Fail:$?; true
20export a=A
21echo Fail:$?; true
22a=A echo Visible:$? # command still runs
23unset a
24echo Fail:$?; true