This commit is contained in:
elam monnot 2022-03-22 11:36:18 +01:00
parent 1b79c265fe
commit bbb3d15dd0
7 changed files with 92 additions and 0 deletions

View File

@ -0,0 +1,10 @@
#!/bin/bash
#set -e
#set -u
fich=users.txt
while read ligne
do
echo "${ligne}"
done < $fich

View File

@ -0,0 +1,21 @@
#!/bin/bash
#set -e
#set -u
fich=$1
if [[ $# -ne 1 ]] ; then
echo "usage : $0 <fichier>"
exit 1
fi
if [[ ! -r "${fich}" ]] ; then
echo "$0 : erreur ouverture fichier ${fich}"
exit 2
fi
while read ligne
do
echo "${ligne}"
done < $fich

View File

@ -0,0 +1,21 @@
#!/bin/bash
#set -e
#set -u
if [[ $# -ne 1 ]] ; then
echo "usage : $0 <fichier>"
exit 1
fi
if [[ ! -r "$1" ]] ; then
echo "$0 : erreur ouverture fichier ${fich}"
exit 2
fi
fich=$1
while read ligne
do
echo "${ligne}"|cut -d: -f1
done < $fich

View File

@ -0,0 +1,23 @@
#!/bin/bash
#set -e
#set -u
if [[ $# -ne 1 ]] ; then
echo "usage : $0 <fichier>"
exit 1
fi
if [[ ! -r "$1" ]] ; then
echo "$0 : erreur ouverture fichier ${fich}"
exit 2
fi
fich=$1
while read ligne
do
login=$(echo "${ligne}"|cut -d: -f1)
long=$(echo "${ligne}"|cut -d: -f2)
echo "${login} ${long}"
done < $fich

View File

View File

@ -0,0 +1,13 @@
#!/bin/bash
#set -e
set -u
qui=$1
who|grep "^${qui}" >> /dev/null
if [[ $? -eq 0 ]] ; then
echo "${qui}" "est connecte"
else
echo "${qui}" " n'est pas connecte"
fi
exit 0

View File

@ -0,0 +1,4 @@
lucien:Lucien Aymar
claudine:Claudine Mallard
robert:Robert Menard
marcelle:Marcelle Vincent