Answers for "if else in mac terminal"

1

if else in mac terminal

#!/bin/bash

defaultsReturn=$(defaults read com.apple.finder AppleShowAllFiles)

if [ '1' = "$defaultsReturn" ]; then
    echo "AppleShowAllFiles is enabled"
elif [ '0' = "$defaultsReturn" ]; then
    echo "AppleShowAllFiles is not enabled"
else
    echo "defaults returned some other value: $defaultsReturn"
fi
Posted by: Guest on March-12-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language