Read command issue with backspace

I would like to give input set of lines from command line and store it in a variable, which can be used later for parsing. With below command, I am able to do. However, I am unable to edit the line(given as input) like selecting "Backspace" key. If I use -e to the read command, I can edit the line but unable to go to next line (when I click on "Enter" key ). Basically ( $'\e' ) is the "Esc" key, where it will help to come out of the read (input line).

read -r -d $'\e' var

Can someone help here. How to edit input of lines from command line in interactive way.

Thanks

1 Like

Hi there,
We are not mind-readers in this forum, if you do not give us the basic information needed to figure out your issue, guessing is far from being the best option: All new threads need to show in the first post:
Architecture and OS
OS level
Shell used

As the output of same unix/linux command can see their output differ...
The same goes for the code behind backspace key...

1 Like

Spammy links, poorly formatted links and text.