OpenSource For You

Script recipes

-

We are now familiar with the script command and we have also looked at a few examples. Let us now discuss a few recipes related to this command.

Recipe 1. Record and play back terminal sessions: We can record the order and timing of the command into a plain text file. Later on, we can revisit it by replaying it. Timing informatio­n ensures that the output happens at the same speed as it originally appeared when the script was recorded. Trust me, you will be amazed at what you see.

To start the terminal recording, execute the following command: 3. Switch to the second terminal and perform the ‘cat’

operation on the named pipe: 4. Switch back to the first terminal and type a few commands. You will observe that anything typed on the first terminal will be broadcast to the second terminal. To stop broadcasti­ng, quit the script session.

 ??  ??

Newspapers in English

Newspapers from India