Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我当前的代码:
if [ $(getent group administrators) ]; then echo "Group exists" else echo "Group does not exist" fi
我的问题是:
如何通过使其包含更多要显示的组来改进它?
并显示组例如管理员,出现在回声中如:组管理员,学生是否存在?
用于&&测试多个条件。
&&
if [ $(getent group administrators) ] && [ $(getent group students) ] then echo The groups administrators and students exit else echo The groups administrators and students do not both exist fi