-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc6e1
More file actions
40 lines (36 loc) · 827 Bytes
/
c6e1
File metadata and controls
40 lines (36 loc) · 827 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
38
39
40
#!/bin/bash
#
# Capitulo 6 exercicio 1
#
if [ $# -ne 1 ] # Recebi 1 parametro?
then
echo "Uso: $0 <Nome do Arquivo com conteudo do e-mail>"
exit 1
fi
# Serah que o arquivo existe?
if ls $1 > /dev/null 2>&1
then
cat ArqOLs |
while read lixo Maquina Opers
do
echo 'mail '`echo $Opers | cut -f1 -d" "`"@$Maquina < $1"
done
else
echo $1 nao existe neste diretorio
exit 2
fi
### O ultimo if e seu conteudo poderia (e deveria) ser escrito assim: ###
#
# if [ -f "$1" ]
# then
# cat ArqOLs |
# while read lixo Maquina Oper lixo
# do
# echo "mail $Oper@$Maquina < $1"
# done
# else
# echo $1 nao existe neste diretorio
# exit 2
# fi
#
###########################################################################