📜  return boolean bash - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:28.248000             🧑  作者: Mango

代码示例1
#!/bin/bash
isdirectory() {
  if [ -d "$1" ]
  then
    true
  else
    false
  fi
}

if isdirectory $1; then echo "is directory"; else echo "nopes"; fi