随笔分类 - Shell
摘要:场景:让用户输入 yes 再执行下一步 read -p "Please type 'yes' to continue: " input if [ "$input" != "yes" ]; then echo "You did not enter 'yes'. Exit..." exit 1 fi
阅读全文
摘要:#!/usr/bin/env bash set -xeuo pipefail # 需要以 root 运行,或者 sudo if [ `id -u` -ne 0 ] then echo Please run this script as root or using sudo! exit fi User
阅读全文

浙公网安备 33010602011771号