Answer the question
In order to leave comments, you need to log in
How to write a bash script that counts the number of commands executed?
When closing the console, it is necessary to display a message with the number of commands executed for the current session, the history command does not work in a bash script, what other options are there?
Answer the question
In order to leave comments, you need to log in
Make a variable and plus after each command.
var=$((var+1))
((var=var+1))
((var+=1))
((var++))
let "var=var+1"
let "var+=1"
let "var++"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question