[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] counter for executed commands in non interactive mode?
From: |
Stephane Chazelas |
Subject: |
Re: [Help-bash] counter for executed commands in non interactive mode? |
Date: |
Mon, 18 May 2015 16:47:46 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
2015-05-18 15:48:06 +0200, Meike Stone:
> Hello,
>
> is there a easy way, to count inside a bash script the executed
> (external) commands while this script itself is executed?
> Normaly, the commands are counted in the interactive mode and
> displayed in the command prompt if "\#" is configured.
> Maybe, there is a possibility to access this counter?
[...]
What number should it give you after:
{ cmd1; cmd2; } | cmd3 | cmd4
(cmd1; cmd2); env cmd3
sh -c 'cmd1; cmd2'
for i in 1 2 3; do
cmdx "$i"
done
?
--
Stephane