Toggle navigation
Email or Username
Password
Remember
Login
Register
|
I forgot my password
Questions
Unanswered
Tags
Users
Ask a Question
How to write a bash script that counts the number of performed commands?
0
like
0
dislike
4
views
Necessary when closing the console will display a message with the number of performed commands for the current session, the history command does not work in bash script, what are the other options?
linux
asked
Apr 13, 2019
by
Vlad_beg
|
4
views
answer
comment
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
2
Answers
0
like
0
dislike
Make a variable and put it in after each command.
var=$((var+1)) ((var=var+1)) ((var+=1)) ((var++)) let "var=var+1" let "var+=1" let "var++"
answered
Apr 17, 2019
by
NeiroNx
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
works, Google "getting data from command output" :)
but it is better to read in the script ~/.bash_history directly.
answered
Apr 17, 2019
by
Vlad_beg
ask related question
comment
Please
log in
or
register
to add a comment.
Related questions
0
like
0
dislike
1
answer
How to make in bash script when using sshpass subsequent commands executed using the password?
asked
Jun 11, 2019
by
frizesb
bash
passwords
0
like
0
dislike
4
answers
How can I integrate some commands in bash?
asked
Apr 9, 2019
by
aleksmanson
linux
bash
0
like
0
dislike
1
answer
How to make a query that counts the number of all new comments across all topics for a user given the date of the last viewing topics?
asked
Jun 14, 2019
by
vaserguy
mysql
0
like
0
dislike
1
answer
How to make sql query that counts the number of different cells?
asked
Apr 11, 2019
by
tolsor
mysql
0
like
0
dislike
1
answer
How to create a number of files using bash script?
asked
Aug 17, 2019
by
getto212
linux
bash
Most popular tags
javascript
php
css
html
jquery
wordpress
python
linux
web-development
mysql
android
windows
java
layout
c#
computer-networks
node.js
cpp
iron
yii
vue.js
1C-Bitrix
react
laravel
django
nginx
system-administration
search-engine-optimization
api
ubuntu
the-it-education.
ajax
sql
programming
hosting
cms
design
apache
google-chrome
bootstrap
Vkontakte
macos
google
network-administration
git
laptops
algorithms
regular-expressions
unity-game-engine
email
angular
database
network-equipment
software
wooŃommerce
debian
.net
ios
information-security
video
law-in-it
browsers
books
parsing
wi-fi
game-development
career
htaccess
postgresql
telegram
mikrotik
mobile-development
ruby-on-rails
the-domain-name-system
modx
Yandex
c
json
opencart
Habr
freelance
vpn
asp.net
windows-server
symfony
bots
hard-drives
math
qt
DIY
audio
frontend
payment-system
bash
electronics
gulp.js
user-interface
docker
online-shopping
110,608
questions
257,186
answers
0
comments
33,652
users