forked from tyleransom/DScourseS18
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmutter.sh
More file actions
executable file
·26 lines (23 loc) · 782 Bytes
/
mutter.sh
File metadata and controls
executable file
·26 lines (23 loc) · 782 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
#!/bin/sh
## declare an array variable
declare -a arr=("email1"
"email2"
"emailN")
declare -a parr=("pass1"
"pass2"
"passN")
x=1
## now loop through the above array
for i in "${arr[@]}"
do
x=$[$x +1]
uname="ouecon"$(printf "%03d " $x)
touch information.txt
echo "The following email has been auto-generated by Professor Ransom and includes your login credentials to the OSCER computing cluster for Spring 2018." >> information.txt
echo "" >> information.txt
echo "" >> information.txt
echo "Username: $uname" >> information.txt
echo "Temporary password: ${parr[$[$x-2]]}" >> information.txt
mutt -s 'OSCER login credentials' $i < information.txt
rm -f information.txt
done