[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bugreport builtin command 'read'
From: |
Greg Wooledge |
Subject: |
Re: Bugreport builtin command 'read' |
Date: |
Thu, 4 Jan 2018 09:49:19 -0500 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Thu, Jan 04, 2018 at 03:34:40PM +0100, skynet@top-email.net wrote:
> Without the -n option, the read command is always terminated with a line break
Untrue. Without -s, read simply echoes what the user types. That
includes that newline (Enter) that normally terminates input (unless
overridden by -d or -n or -N).
E.g.:
wooledg:~$ read -s -p "Password: " password; echo "got it"
Password: got it
wooledg:~$
There's no "line break" after I enter the password, because the -s option
suppresses echoing back my input, which includes the Enter. If I want
a newline there, it's my job as the script writer to print one.