A
A
Alistair O2017-02-02 13:54:48
linux
Alistair O, 2017-02-02 13:54:48

Logging clicks, how?

Good afternoon, I found an article on Habré, there is a script that logs the character set in the terminal,
but for some reason it doesn’t work for me, what am I doing wrong?
here is the script:

#!/bin/bash
if [ "$TERM" != "" ]; then
  DATE=`date +%F.%H.%M`
  FOLDER="/tmp/"
  exec script -q -t $FOLDER$USER.$DATE 2> $FOLDER$USER.$DATE.time
else 
  /bin/bash $*
fi

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alister O, 2017-02-03
@box4

for example here: if you run the script, then everything is fine except for tabs

[[email protected] ~]$ exec script -q -t file1
0.157724 17
           0.022777 24
                      [[email protected] ~]$ 0.001362 1
                                                i8.070597 1
                                                           t1.600985 1
                                                                      s0.503001 1
                                                                                  0.935985 1
                                                                                            t0.288037 1
                                                                                                       e0.160017 1
                                                                                                                  x0.232955 1
                                                                                                                             t0.135985 65

bash: its: command not found
[[email protected] ~]$ 0.688265 1
                          c1.222748 1
                                     a0.119990 1
                                                l0.177008 2

0.288006 186
                January 2017    
Su Mo Tu We Th Fr Sa
 1  2  3  4  5  6  7
 8  9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

[[email protected] ~]$ 0.001126 1
                          e2.550873 1
                                     x0.328021 1
                                                i1.224970 1
                                                           t0.080036 8

exit

Connection closed by foreign host.

and this is how the log says
[[email protected] ~]$ cat file1 
Script started on Mon 30 Jan 2017 03:40:29 AM EST
[[email protected] ~]$ its text
bash: its: command not found
[[email protected] ~]$ cal
    January 2017    
Su Mo Tu We Th Fr Sa
 1  2  3  4  5  6  7
 8  9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

a tty fork is created, how to solve?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question