Last active
March 18, 2020 03:45
-
-
Save workze/fc312df6fad2bb6b7d6b74a25459ebce to your computer and use it in GitHub Desktop.
linux shell bash script if
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
install() { | |
echo "hi" | |
} | |
if [[ "$1" == "install" || "$1" == "start"]]; | |
then $1; | |
else | |
echo -e "Uxc"; | |
fi | |
if [ 条件判断式1 ] | |
then | |
当条件判断式1成立时,执行程序1 | |
elif [ 条件判断式2 ] | |
then | |
当条件判断式2成立时,执行程序2 | |
...更多判断... | |
else | |
当所有条件都不成立时,最后执行此程序 | |
fi | |
nvidia-container-cli info 2> /dev/null && run_gpu || run_cpu | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment