John Smith
John Smith

Reputation: 4353

Bash - read without echoing back

I'd like to read in a line of text provided by the user.

However, I do not want it to be echo'd back once they press enter, similarly to read -s.

However, I want them to see what they are writing, before they press enter (while read -s completely hides it, as its meant for passwords).

Upvotes: 0

Views: 725

Answers (1)

William Pursell
William Pursell

Reputation: 212248

This is fragile, but you might just want:

#!/bin/bash

read var
tput cuu 1
tput el

Upvotes: 2

Related Questions