How can we give a command to press any key during the script? ex: 1. I want to create anew file: vi test.txt 2. I added some sample data to it 3. I want to press **ESC** (in order to exit insert mode) 4. Save the file How can we pass the command to press ESC key?