i have probably some nooby question
how can I call a defined function in a if statement in bash?
Have a look on my example:
#!/bin/bash -x
Variable_A=xyz
function_x() {
echo "hello everyone"
}
#here I want to define a if statement after the function
if Variable_A == working;then
function_x()
#here I have a while for the parameters in bash example:
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-s|--status)
Variable_A="$2"
shift
shift
;;
esac
done
so the idea is when I run the script let's call it test.sh it runs the script exp in bash:
./test.sh working
I am not sure how to create something like this, maybe some of you can help me out on this.
Thank you in advance