Besoin de traduction
john
-
Phasme Messages postés 17 Statut Membre -
Phasme Messages postés 17 Statut Membre -
Bonjour,
J'ai fait un petit script et je dois le corriger mais je ne comprend pas le problème et donc, je ne sais pas quoi faire pour le corriger.
"Your ?permissions? script doesn?t produce any output other than the header information. "
Quelqu'un peu me dire qu'est-ce que ca veut dire ? merci
Actuellement la sortie de mon scripte affiche le résultat dans un fichier.
Merci pour votre aide
J'ai fait un petit script et je dois le corriger mais je ne comprend pas le problème et donc, je ne sais pas quoi faire pour le corriger.
"Your ?permissions? script doesn?t produce any output other than the header information. "
Quelqu'un peu me dire qu'est-ce que ca veut dire ? merci
Actuellement la sortie de mon scripte affiche le résultat dans un fichier.
Merci pour votre aide
A voir également:
- Besoin de traduction
- Google traduction photo - Guide
- Hibiki traduction telecharger - Accueil - Intelligence artificielle
- Traduction de site web - Guide
- Bible hébreu traduction mot à mot pdf - Télécharger - Vie quotidienne
- Waldik traduction - Forum Réseaux sociaux
7 réponses
#!bin/bash
# Program 'usern' - takes 1 argument being a file (az)
# Read the input file and look for occurrences of the current user who is executing the script.
# On finding an occurrence of the username take that line and append it to a file (test)
# and display a line number and a bracket against the saved line.
# create a file or overwrite it if it already exist
# verify if input is not null
length=$(echo -n $1 | wc -c)
if [ $length -eq 0 ]
then
# parameters missing
echo "Sorry but you must write a parameter"
exit 0
fi
>test
cpt=1 #counter
for occurrence in $(grep -E '^(PWD|USER|MAIL|LOGNAME|HOME)' $1)
do
echo "$cpt) $occurrence" >> test
cpt=$((cpt+1))
done
# Program 'usern' - takes 1 argument being a file (az)
# Read the input file and look for occurrences of the current user who is executing the script.
# On finding an occurrence of the username take that line and append it to a file (test)
# and display a line number and a bracket against the saved line.
# create a file or overwrite it if it already exist
# verify if input is not null
length=$(echo -n $1 | wc -c)
if [ $length -eq 0 ]
then
# parameters missing
echo "Sorry but you must write a parameter"
exit 0
fi
>test
cpt=1 #counter
for occurrence in $(grep -E '^(PWD|USER|MAIL|LOGNAME|HOME)' $1)
do
echo "$cpt) $occurrence" >> test
cpt=$((cpt+1))
done
Désolé, je me suis trompé de script :(
Voici le bon :
#! /bin/bash
# verify if parameter exist
length=$(echo -n $1 | wc -c)
if [ $length -eq 0 ]
then
# parameters missing
echo "Sorry but you must write a parameter"
exit 0
fi
var=$(ls -l "$1" | cut -d" " -f1)
varUser=$(echo "$var" | cut -c2-4)
varGroupe=$(echo "$var" | cut -c5-7)
varOthers=$(echo "$var" | cut -c8-10)
userName=$(ls -l $1 | cut -d ' ' -f3)
owner="OWNER"
group="GROUP\t\t\t"
others="OTHER\t\t\t"
# put separate rights in a file - test
echo -e "$varUser\n$varGroupe\n$varOthers" > test
# display title
echo -e "\t\t\t\tREAD\tWRITE\tEXECUTE"
i=1
while read line
do
if [ "$i" == 1 ]
then param="$owner $userName"
elif [ "$i" == 2 ]
then param=$group
else param=$others
fi
# display the right by category
case "$line" in
---) echo -e "$param\tNO \tNO \tNO "
;;
--x) echo -e "$param\tNO \tNO \tYES"
;;
-w-) echo -e "$param\tNO \tYES\tNO "
;;
-wx) echo -e "$param\tYES\tYES\tYES"
;;
r--) echo -e "$param\tYES\tNO \tNO "
;;
r-x) echo -e "$param\tYES\tNO \tYES"
;;
rw-) echo -e "$param\tYES\tYES\tNO "
;;
rwx) echo -e "$param\tYES\tYES\tYES"
;;
esac
i=$(expr $i + 1)
done < test
Qu'est-ce que je dois faire pour arranger ca ?
"The script doesn't produce any output other than the header information" JE ne comprend pas tropce que ca veut dire. Merci
Voici le bon :
#! /bin/bash
# verify if parameter exist
length=$(echo -n $1 | wc -c)
if [ $length -eq 0 ]
then
# parameters missing
echo "Sorry but you must write a parameter"
exit 0
fi
var=$(ls -l "$1" | cut -d" " -f1)
varUser=$(echo "$var" | cut -c2-4)
varGroupe=$(echo "$var" | cut -c5-7)
varOthers=$(echo "$var" | cut -c8-10)
userName=$(ls -l $1 | cut -d ' ' -f3)
owner="OWNER"
group="GROUP\t\t\t"
others="OTHER\t\t\t"
# put separate rights in a file - test
echo -e "$varUser\n$varGroupe\n$varOthers" > test
# display title
echo -e "\t\t\t\tREAD\tWRITE\tEXECUTE"
i=1
while read line
do
if [ "$i" == 1 ]
then param="$owner $userName"
elif [ "$i" == 2 ]
then param=$group
else param=$others
fi
# display the right by category
case "$line" in
---) echo -e "$param\tNO \tNO \tNO "
;;
--x) echo -e "$param\tNO \tNO \tYES"
;;
-w-) echo -e "$param\tNO \tYES\tNO "
;;
-wx) echo -e "$param\tYES\tYES\tYES"
;;
r--) echo -e "$param\tYES\tNO \tNO "
;;
r-x) echo -e "$param\tYES\tNO \tYES"
;;
rw-) echo -e "$param\tYES\tYES\tNO "
;;
rwx) echo -e "$param\tYES\tYES\tYES"
;;
esac
i=$(expr $i + 1)
done < test
Qu'est-ce que je dois faire pour arranger ca ?
"The script doesn't produce any output other than the header information" JE ne comprend pas tropce que ca veut dire. Merci
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question