Article 5KKJ0 Kubuntu 21.04 - How to tell bash "Press Enter to exit"?

Kubuntu 21.04 - How to tell bash "Press Enter to exit"?

by
Snugbug
from LinuxQuestions.org on (#5KKJ0)
I have a bash that executes some commands in the terminal and at the end of that bash, I want it to display a message saying "Press ENTER to exit..." (with no timeout, i.e. the bash should wait indefinitely for the ENTER key to be pressed). After the ENTER key has been pressed, I want the bash to exit and the terminal to close automatically.

I tried

Code:#!/bin/bash

# some commands...

read -p "Press the ENTER key to exit ... " Enter
exitbut that doesn't work.

How can I make it work right, please?latest?d=yIl2AUoC8zA latest?i=ZdRp-TASsaE:fB7aHkTE-a4:F7zBnMy latest?i=ZdRp-TASsaE:fB7aHkTE-a4:V_sGLiP latest?d=qj6IDK7rITs latest?i=ZdRp-TASsaE:fB7aHkTE-a4:gIN9vFwZdRp-TASsaE
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments