On Tue, Nov 22, 2022 at 2:11 PM Praju <prajuhg...@gmail.com> wrote:

> Hi,
> below is my configuration:
>
>     echo "welcome"
>     echo ${var}      ( Note : I am not defined var)
>     echo "hello"
>
> expected output status: failure
>
> output:
>
>              + echo welcome
>                 welcome
>              + echo
>
>               + echo hello
>                  hello
>               Finished: SUCCESS
>

`echo ${var}` didn't fail. As you can see, it printed an empty line. By
default, bash allows references to undefined variables. Use `set -o
nounset` to change this behavior.

This really isn't a Jenkins question, this is a question about shell use,
and should be asked in the appropriate forum.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAMo7PtKfohPW6id9b1KW7-KcmRg%3Dum9CT%2Be%2B4VG_b9XW6rO6VA%40mail.gmail.com.

Reply via email to