Answers for "bash scripting boolean"

5

bash test boolean

the_world_is_flat=true
# ...do something interesting...
if [ "$the_world_is_flat" = true ] ; then
    echo 'Be careful not to fall off!'
fi
Posted by: Guest on March-06-2020
0

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
Posted by: Guest on April-26-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language