On Thu, Mar 15, 2012 at 08:18:10AM -0600, Bill Gradwohl wrote:
> I'm experimenting and came up with something I can't explain.
>
> #!/bin/bash
> declare parm='pass1'
> #case "${parm}" in
> # 'pass1')
> set -v
> if true; then echo True; fi
> # ;;
> # *)
> # echo Hello
> # ;;
> #esac
>
> When executed, the above works as expected.
>
> If you remove the octothorpes to activate the case statement and run it
> again, the set -v appears non functional.
Manual says:
-v Print shell input lines as they are read.
The entire case statement is read without "-v" in effect. Another line
isn't read by bash until after the esac.