Date: 24 Aug 1999 17:03:31 +0200 From: Thomas Gellekum <tg@ihf.rwth-aachen.de> To: Sheldon Hearn <sheldonh@uunet.co.za> Cc: chris@calldei.com, Chris Piazza <cpiazza@home.net>, freebsd-bugs@FreeBSD.ORG Subject: Re: bin/13274: /bin/sh 'read' command does not work correctly Message-ID: <kq7lmlz0e4.fsf@zabagek.ihf.rwth-aachen.de> In-Reply-To: Sheldon Hearn's message of "Tue, 24 Aug 1999 16:52:07 %2B0200" References: <73542.935506327@axl.noc.iafrica.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Sheldon Hearn <sheldonh@uunet.co.za> writes: > This doesn't help the poor bastard who'd like to know what happens if he > _doesn't_ specify -r. :-) Index: sh.1 =================================================================== RCS file: /home/ncvs/src/bin/sh/sh.1,v retrieving revision 1.23.2.2 diff -u -r1.23.2.2 sh.1 --- sh.1 1999/04/19 18:54:06 1.23.2.2 +++ sh.1 1999/08/24 14:59:39 @@ -1150,7 +1150,7 @@ it faster. However, if the current directory is renamed, the builtin version of pwd will continue to print the old name for the directory. -.It Li "read [ -p prompt ] [ -t timeout ] [ -e ] variable ... +.It Li "read [ -p prompt ] [ -t timeout ] [ -e ] [ -r ] variable ... The prompt is printed if the -p option is specified and the standard input is a terminal. Then a line is read from the standard input. The trailing newline @@ -1162,6 +1162,13 @@ separated them) are assigned to the last variable. If there are more variables than pieces, the remaining variables are assigned the null string. +.Pp +Backslashes are treated specially. If a backslash is followed by +a newline, the backslash and the newline will be +deleted. If a backslash is followed by any other +character, the backslash will be deleted and the following +character will be treated as though it were +not in IFS, even if it is. .Pp If the -t option is specified the timeout elapses before any input is supplied, the read command will @@ -1170,13 +1177,10 @@ explicitly specify seconds, minutes or or hours. If none is supplied, 's' is assumed. .Pp -The -e option causes any backslashes in the input to -be treated specially. If a backslash is followed by -a newline, the backslash and the newline will be -deleted. If a backslash is followed by any other -character, the backslash will be deleted and the following -character will be treated as though it were -not in IFS, even if it is. +The -e option exists only for backward compatibility with older scripts. +.Pp +The -r option causes backslashes in the input to be treated +like ordinary characters. .It readonly name ... The specified names are marked as read only, so that they cannot be subsequently modified or unset. The shell tg To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?kq7lmlz0e4.fsf>