When trying to debug a problem it sometimes helps to have a transcript of everything that happened on the console. Enter the Linux script command.
Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1).
It is also useful for old timers who are with increasing frequency called upon to do system archeology to discover exactly what a decades old program is really doing.
Invoke like this:
The utility will then start a transcript of everything that happens next.
Script started on Wed 20 Mar 2013 09:52:51 AM EDT ^0;me@test:~/bin^G^[[?1034h[me@test bin]$ perl^H^[[K^H^[[K^H^[[Kp^H^[[Khp ldap_test.php^M LDAP query test^M Connecting using LDAPS...^M ldap_create^M ldap_url_parse_ext(ldaps://ldap.example.com)^M connect result is Resource id #4^M ldap_extended_operation_s^M ldap_extended_operation^M ldap_send_initial_request^M ldap_new_connection 1 1 0^M ldap_int_open_connection^M
Those “^M” characters are old-style Windows carriage returns. How user friendly!
To end transcription do a “CNTRL-D” in the console.