I created a simple script in bash for showing logs, I read the docs of bash scripts, and actually I did everything right, but my script not working. I'm really rookie in sh scripts so I need to ask about it here. So my script is:
#!/bin/bash
echo How many lines of log you want to see:
read linesCount
echo 'What type of log you want to see? (info / error / warn) type all or just hit enter to see all types of logs.'
read logType
if [${#logType} -lt 3]
then
tail -n $linesCount root/projects/retwiter/logs/logs.log |grep $logType
fi
When I run the script it shows me this:
show-retwiter-logs.sh: 8: show-retwiter-logs.sh: [5: not found
In the second 'record' I typed error it is why this shows it -> [5: not found
But I actually don't know why