小编Gav*_*per的帖子

在意外令牌"完成"附近出现Shell语法错误

该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)

shell token

2
推荐指数
1
解决办法
8869
查看次数

标签 统计

shell ×1

token ×1