该shell脚本应该将用户添加到系统中.新用户详细信息位于文件中.shell使用以下消息拒绝此脚本:
syntax error near unexpected token 'done'.
Run Code Online (Sandbox Code Playgroud)
怎么了?
#!/bin/bash
#Purpose: Automatically add new users in a linux system based upon the data found within a text file
# Assign encryped passwords to each user
# Add users to groups or create new groups for these users
# Report errors and successful operations where necessary in log files
# post help options (echo)
#Root validation
if [[ $(id -u) -eq 0 ]]; then
#Argument validation
if [[ -z "$1" ]]; then …Run Code Online (Sandbox Code Playgroud)