mirror of
https://github.com/ellysh/bash-programming-from-scratch.git
synced 2026-01-26 07:43:42 +00:00
38 lines
540 B
Bash
38 lines
540 B
Bash
#!/bin/bash
|
|
|
|
code_to_error_de()
|
|
{
|
|
case $1 in
|
|
1)
|
|
echo "Der Datei wurde nicht gefunden:"
|
|
;;
|
|
2)
|
|
echo "Berechtigung zum Lesen der Datei verweigert:"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
code_to_error_en()
|
|
{
|
|
case $1 in
|
|
1)
|
|
echo "File not found:"
|
|
;;
|
|
2)
|
|
echo "Permission to read the file denied:"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
print_error()
|
|
{
|
|
if [[ "$LANG" == de_DE* ]]
|
|
then
|
|
echo "$(code_to_error_de $1) $2" >> debug.log
|
|
else
|
|
echo "$(code_to_error_en $1) $2" >> debug.log
|
|
fi
|
|
}
|
|
|
|
print_error 1 "readme.txt"
|