#!/bin/sh
if [ $num -eq 9 -o $num -eq 75 -o $num -eq 200 ]; then
echo "do this"
elif [ $num -eq 40 -o $num -eq 53 -o $num -eq 63]; then
echo "do something for this"
else
echo "for other do this"
fi
Run Code Online (Sandbox Code Playgroud)
有没有其他方法可以缩小if
语句中的表达式?也许像
[ $num -eq (9,75,200) ]
Run Code Online (Sandbox Code Playgroud)
顺便说一句,我在这个操作系统上没有 GNU 实用程序。
有什么方法可以配置 OpenSSH( /etc/ssh/sshd_config
) 服务器以允许必须使用密码短语的私钥吗?