Lines Matching defs:foo

90 x=$(foo=abc $SHELL <<!
91 foo=bar
92 $SHELL -c 'print \$foo'
104 readonly $a=foo
105 if [[ $b != foo ]]
135 unset -f foo
136 function foo
143 foo 1
147 foo
153 unset foo
154 foo=bar
155 if [[ $(export | grep ^foo=) != 'foo=bar' ]]
158 unset foo
159 read foo <<!
162 if [[ $(export | grep ^foo=) != 'foo=bar' ]]
213 [[ $($SHELL -c 'unset foo;typeset -Z2 foo; print ${foo:-3}' 2> /dev/null) == 3 ]] || err_exit '${foo:-3} not 3 when typeset -Z2 field undefined'
214 [[ $($SHELL -c 'unset foo;typeset -Z2 foo; print ${foo:=3}' 2> /dev/null) == 03 ]] || err_exit '${foo:=-3} not 3 when typeset -Z2 foo undefined'
215 unset foo bar
219 export foo=hello
221 [[ $foo == hello ]] || err_exit 'export scoping problem in function'
224 [[ $(export | grep foo) == 'foo=hello' ]] || err_exit 'export not working in functions'
250 foo=bar
266 foo=abc
267 x='typeset -n z=foo'
272 unset foo z
284 function foo
289 [[ $(foo) == bar=xxx ]] || err_exit 'typeset -p not working inside a function'
290 unset foo
291 typeset -L5 foo
292 [[ $(typeset -p foo) == 'typeset -L 5 foo' ]] || err_exit 'typeset -p not working for variables with attributes but without a value'
294 typeset -L3 foo=aaa
295 typeset -L6 foo=bbbbbb
296 [[ \$foo == bbbbbb ]]
300 typeset -R3 foo=aaa
301 typeset -R6 foo=bbbbbb
302 [[ \$foo == bbbbbb ]]
307 unset foo
308 typeset -b -Z10 foo
309 read foo <<< 'abcdefghijklmnop'
310 [[ $foo == "$expected" ]] || err_exit 'read foo, where foo is "typeset -b -Z10" not working'
311 unset foo
312 typeset -b -Z10 foo
313 read -N10 foo <<< 'abcdefghijklmnop'
314 [[ $foo == "$expected" ]] || err_exit 'read -N10 foo, where foo is "typeset -b -Z10" not working'
315 unset foo
316 typeset -b -A foo
317 read -N10 foo[4] <<< 'abcdefghijklmnop'
318 [[ ${foo[4]} == "$expected" ]] || err_exit 'read -N10 foo, where foo is "typeset -b -A" foo not working'
319 unset foo
320 typeset -b -a foo
321 read -N10 foo[4] <<< 'abcdefghijklmnop'
322 [[ ${foo[4]} == "$expected" ]] || err_exit 'read -N10 foo, where foo is "typeset -b -a" foo not working'
323 [[ $(printf %B foo[4]) == abcdefghij ]] || err_exit 'printf %B for binary associative array element not working'
324 [[ $(printf %B foo[4]) == abcdefghij ]] || err_exit 'printf %B for binary indexed array element not working'
325 unset foo
327 $SHELL 2> /dev/null -c 'export foo=(bar=3)' && err_exit 'compound variables cannot be exported'
350 "$EDT $PDT $EDT" "foo=bar" "TZ=$PTZ" "TZ=$ETZ" \
412 HISTFILE=foo
414 HISTFILE=foo
415 [[ $HISTFILE == foo ]] || err_exit 'typeset -u PS1 affects HISTFILE'
426 $SHELL -c 'typeset v=foo; [[ $(typeset -p v[0]) == v=foo ]]'
437 z='typeset -C z=(foo=bar)'
440 z='typeset -A y=([a]=foo)'
447 [[ ${x:=foo} == foo ]] || err_exit '${x:=foo} with x unset, not foo when x is a lowercase variable'
463 typeset -L -Z x=foo
464 [[ $(typeset -p x) == 'typeset -Z 3 -L 3 x=foo' ]] || err_exit '-LRZ without [n] not defaulting to width of variable'
466 unset foo
467 typeset -Z2 foo=3
468 [[ $(typeset -p foo) == 'typeset -Z 2 -R 2 foo=03' ]] || err_exit '-Z2 not working'
469 export foo
470 [[ $(typeset -p foo) == 'typeset -x -Z 2 -R 2 foo=03' ]] || err_exit '-Z2 not working after export'