[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How many chars read -r line can read from tty?
From: |
alex xmb sw ratchev |
Subject: |
Re: How many chars read -r line can read from tty? |
Date: |
Wed, 15 May 2024 22:51:52 +0200 |
never heard of
< <( perl -e ' print "a" x2048 ' ) read -r line ; echo ${#line}
2048
u did mess with $IFS ?
On Wed, May 15, 2024, 22:48 Peng Yu <pengyu.ut@gmail.com> wrote:
> Hi,
>
> read -r line; echo ${#line}
>
> The above code does not work when the input is long. I tried to paste
> to the terminal a string of 1024 characters. When I type return, I
> just hear beeping. read won't finish so that the length of $line can
> be printed.
>
> If I try a string with length 1023, it will finish correctly and print
> 1023.
>
> Anybody know why there is such a limit?
>
> --
> Regards,
> Peng
>
>