Моя проблема в том, что я не могу запустить функцию order_sessions () ...
Я уже видел, есть ли у меня псевдонимы, а у меня их нет. Я использую более новую MacOS, но я уже пробовал в Linux ...
#!/bin/bash
path="/var/log/wtmp"
file_array=()
function read_file(){
while IFS= read -r line; do
file_array+=("$line")
done < "$path"
}
read_file()
function order_sessions(){
case $2 in
-r)
statements ;;
-n )
statements ;;
-t )
statements ;;
-a )
statements ;;
-i )
statements ;;
esac
}
case $1 in
)
if [![ -z "$2" ]]
then
fi
statements ;;
-g )
statements ;;
-u )
statements ;;
-s )
statements ;;
-e )
statements ;;
-f )
path = $2
read_file() ;;
esac
Терминал выдает мне эту ошибку:
./userstats.sh: line 18: syntax error near unexpected token `function'
./userstats.sh: line 18: `function order_sessions(){'