Hi all: Being new to BASH scripting, I am having a hard time getting my head around boolean usage. Below is some code that does not work properly. Looking at various online docs, it appears to me that this should work, but does not.
Thanks, Chris.
Code:
function get_host_file_list {
#do something in here
if [ #test results of above ]; then
return 0 #true
else
return 1 #false
fi
}
results=get_host_file_list(#parameters in here)
if [ $results ]; then
#the if statement is always returning true
else
#never gets here
fi