Bash boolean expressions code example
Example: return boolean bash
#!/bin/bash
isdirectory() {
if [ -d "$1" ]
then
true
else
false
fi
}
if isdirectory $1; then echo "is directory"; else echo "nopes"; fi
#!/bin/bash
isdirectory() {
if [ -d "$1" ]
then
true
else
false
fi
}
if isdirectory $1; then echo "is directory"; else echo "nopes"; fi