-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab6.sh
More file actions
executable file
·37 lines (31 loc) · 806 Bytes
/
Copy pathlab6.sh
File metadata and controls
executable file
·37 lines (31 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash -
#===============================================================================
#
# FILE: lab6.sh
#
# USAGE: ./lab6.sh
#
# DESCRIPTION: Manage Users and groups
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: YOUR NAME (),
# ORGANIZATION:
# CREATED: 18/07/18 11:16
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
#groups
sales=('linda' 'laura')
account=('anna' 'anouk')
for user in ${sales[@]}
do
useradd -m -g sales -G users ${user:-user doesnt exist}
done
for user in ${account[@]}
do
useradd -m -g account -G users ${user:-user doesnt exist}
done
exit 0