Trying to read a long input into a variable from ZSH on MacOS.
echo "URL: "
read URL
input is always truncated to 1024 chars... if I try and type additional chars nothing happens.
Input is copy/pasted from PostMan, its an S3 signed upload URL
If I try and delete a few chars from the end (after pasting) I am only able to manually type as many chars as I deleted
I tried using the
-n
option to no avail (nothing gets read into the variable)
How can I read a long input? ~1500 chars
read
, as well as writing into an fd andread
ing that:< <(for i in {1..1500}; do printf "%d" $(( i % 10 )); done; printf "\n") read URL
, thenprintf '%s' $URL | wc
yields 1500). – Marcus Müller Mar 14 '24 at 14:06read URL
command. Are you truly typing 1500 characters on your keyboard, or are you using a mouse to copy from one window (where the displayed text is wrapped) and paste into the window where yourread
command is running? Are there carriage return or Control-D characters in the URL you're typing? – Sotto Voce Mar 14 '24 at 15:50