I need to count the number of lines in a file and then send a message depending if the number of lines is less than or equal to 20. I am trying to do it this way:
touch file.txt
echo "hello" > file.txt
nr_lines = $(wc -l < file.txt)
if[$nr_lines -le 20]; then
echo "number of lines is less than 20."
fi
But it does not work. What am I doing wrong?