mirror of
https://github.com/ellysh/bash-programming-from-scratch.git
synced 2026-01-26 07:43:42 +00:00
21 lines
255 B
Bash
21 lines
255 B
Bash
#!/bin/bash
|
|
|
|
code_to_error()
|
|
{
|
|
case $1 in
|
|
1)
|
|
echo "File not found:"
|
|
;;
|
|
2)
|
|
echo "Permission to read the file denied:"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
print_error()
|
|
{
|
|
echo "$(code_to_error $1) $2" >> debug.log
|
|
}
|
|
|
|
print_error 1 "readme.txt"
|