asd
unknown
plain_text
3 years ago
697 B
5
Indexable
mnozenie () {
if [ $# -ne 2 ]; then
echo "Błąd: Niepoprawna ilość parametrów. Wymagane 2, otrzymano $#" >&2
return 1
fi
result=$(($1 * $2))
echo $result
}
sprawdzenie () {
if [ $# -ne 2 ]; then
echo "Błąd: Niepoprawna ilość parametrów. Wymagane 2, otrzymano $#" >&2
return 1
fi
if [ "$1" != "$2" ]; then
echo "Błąd: Argument 1 ($1) nie jest równy Argumentowi 2 ($2)" >&2
return 1
fi
}
utworz () {
if [ $# -ne 1 ]; then
echo "Błąd: Niepoprawna ilość parametrów. Wymagane 1, otrzymano $#" >&2
return 1
fi
declare -a files=("${!1}")
for file in "${files[@]}"; do
touch "$file"
done
}Editor is loading...