diff --git a/sio1/sisr1/40-Shell/scripts/crsamba.sh b/sio1/sisr1/40-Shell/scripts/crsamba.sh new file mode 100755 index 0000000..097c6ee --- /dev/null +++ b/sio1/sisr1/40-Shell/scripts/crsamba.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +#set -e +#set -u + +fich=users.txt +while read ligne +do + echo "${ligne}" +done < $fich diff --git a/sio1/sisr1/40-Shell/scripts/crsamba2.sh b/sio1/sisr1/40-Shell/scripts/crsamba2.sh new file mode 100755 index 0000000..5f02714 --- /dev/null +++ b/sio1/sisr1/40-Shell/scripts/crsamba2.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +#set -e +#set -u + +fich=$1 + +if [[ $# -ne 1 ]] ; then + echo "usage : $0 " + exit 1 +fi + +if [[ ! -r "${fich}" ]] ; then + echo "$0 : erreur ouverture fichier ${fich}" + exit 2 +fi + +while read ligne +do + echo "${ligne}" +done < $fich diff --git a/sio1/sisr1/40-Shell/scripts/crsamba4.sh b/sio1/sisr1/40-Shell/scripts/crsamba4.sh new file mode 100755 index 0000000..1acaf6f --- /dev/null +++ b/sio1/sisr1/40-Shell/scripts/crsamba4.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +#set -e +#set -u + + +if [[ $# -ne 1 ]] ; then + echo "usage : $0 " + 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 diff --git a/sio1/sisr1/40-Shell/scripts/crsamba5.sh b/sio1/sisr1/40-Shell/scripts/crsamba5.sh new file mode 100755 index 0000000..d82148e --- /dev/null +++ b/sio1/sisr1/40-Shell/scripts/crsamba5.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +#set -e +#set -u + + +if [[ $# -ne 1 ]] ; then + echo "usage : $0 " + 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 diff --git a/sio1/sisr1/40-Shell/scripts/file.pwd b/sio1/sisr1/40-Shell/scripts/file.pwd new file mode 100644 index 0000000..e69de29 diff --git a/sio1/sisr1/40-Shell/scripts/maisQui.sh b/sio1/sisr1/40-Shell/scripts/maisQui.sh new file mode 100755 index 0000000..dfc5a3f --- /dev/null +++ b/sio1/sisr1/40-Shell/scripts/maisQui.sh @@ -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 diff --git a/sio1/sisr1/40-Shell/scripts/users.txt b/sio1/sisr1/40-Shell/scripts/users.txt new file mode 100644 index 0000000..fadc602 --- /dev/null +++ b/sio1/sisr1/40-Shell/scripts/users.txt @@ -0,0 +1,4 @@ +lucien:Lucien Aymar +claudine:Claudine Mallard +robert:Robert Menard +marcelle:Marcelle Vincent