#!/bin/bashadduser () {echo "Copy Authz File Authz to ' date" +%y%m%d%s "'" &&CP authz authz ' Date "+% y%m%d%s "' # more Authz | grep ^[a-z] | grep $DP | Sed ' s/$/&, ' $USER '/g ' > authz.new sed-i '/^ ' $DP '/s/$/, ' $USER '/' authz}process () {if ["$DP"! = ""]t Hen for I in ' more Authz | grep "$DP =" | Grep-v @ | awk ' {print $} ' | TR "," \ n "' Do more passwd | grep $i >/dev/null 2>&1 If [$ = 1]; Then echo "Copy passwd File to passwd ' date" +%y%m%d%s "'" &&CP passwd passwd ' Date "+%y%m%d% S "' sed-i '/' $DP '/a\ ' $i ' = ' $i ' @emoney ' passwd more passwd | grep $i >/dev/null 2>&1 if [$ = 0]; Then echo "User $i Add succes" Else E Cho "User $i Add flase" fi fi doneelse echo "Department ID not set" Fi}read-p "please Input New Userna Me: "Userread-p" please Input Department ID: "Dpcase $DP Inmarket_sem) AddUser sleep 1 process;; Market_ue) AddUser sleep 1 process;; JSB_JG) AddUser sleep 1 process;; JSB_OP) AddUser sleep 1 process;; MARKET_PD) AddUser sleep 1 process;; MARKET_MK2) AddUser sleep 1 process;; MARKET_PR) AddUser sleep 1 process;; *) If ["$DP" = ""] then echo "Department ID not set" Else echo-e "Department mistake\n#### #Detail list######\nmarket_sem\nmarket_ue\njsb_jg\njsb_op\nmarket_pd\nmarket_mk2\ nmarket_pr\n#### #Detail list###### "FI; Esac
SVN Add user Shell