#!/bin/bash
# your code goes here
rc() {
return ${1:-1}
}
false
rc1=$?
true
rc2=$?
if rc $rc1 ; then
echo false = true: $rc1
else
echo false = false: $rc1
fi
if rc $rc2 ; then
echo true = true: $rc2
else
echo true = false: $rc2
fi
if rc "" ; then
echo void = true
else
echo void = false
fi
if rc ; then
echo undef = true
else
echo undef = false
fi
IyEvYmluL2Jhc2gKIyB5b3VyIGNvZGUgZ29lcyBoZXJlCgpyYygpIHsKICAgIHJldHVybiAkezE6LTF9Cn0KCmZhbHNlCnJjMT0kPwoKdHJ1ZQpyYzI9JD8KCmlmIHJjICRyYzEgOyB0aGVuCiAgZWNobyBmYWxzZSA9IHRydWU6ICRyYzEKZWxzZQogIGVjaG8gZmFsc2UgPSBmYWxzZTogJHJjMQpmaQoKaWYgcmMgJHJjMiA7IHRoZW4KICBlY2hvIHRydWUgPSB0cnVlOiAkcmMyCmVsc2UKICBlY2hvIHRydWUgPSBmYWxzZTogJHJjMgpmaQoKaWYgcmMgIiIgOyB0aGVuCiAgZWNobyB2b2lkID0gdHJ1ZQplbHNlCiAgZWNobyB2b2lkID0gZmFsc2UKZmkKCmlmIHJjIDsgdGhlbgogIGVjaG8gdW5kZWYgPSB0cnVlCmVsc2UKICBlY2hvIHVuZGVmID0gZmFsc2UKZmk=