u/GaramChandraGandhi

Image 1 — Bro thought deleting his comments would stop me... 💀
Image 2 — Bro thought deleting his comments would stop me... 💀
Image 3 — Bro thought deleting his comments would stop me... 💀
Image 4 — Bro thought deleting his comments would stop me... 💀
Image 5 — Bro thought deleting his comments would stop me... 💀
Image 6 — Bro thought deleting his comments would stop me... 💀
Image 7 — Bro thought deleting his comments would stop me... 💀
Image 8 — Bro thought deleting his comments would stop me... 💀
Image 9 — Bro thought deleting his comments would stop me... 💀
Image 10 — Bro thought deleting his comments would stop me... 💀

Bro thought deleting his comments would stop me... 💀

There was that "drop your first 5 emojis" post.

Everyone else was just having fun.

Meanwhile, u/DevilOfFate was conducting free personality assessments... but somehow only under comments with female avatars.

So I replied:

> "Bro's entire personality is camping under girls' comments. 💀"

He deleted it. =⁠_⁠=

So I did what any reasonable Redditor would do... O_o

I copied that exact same reply and pasted it under every single one of his comments on the post.

Every. Single. One.

Bro started deleting comments like HR had just joined the thread... TwT

Brother... you underestimated two things: my pettiness and Ctrl+C + Ctrl+V. 💀

See you in the next comment section, u/DevilOfFate ...

Bwahahahaha! 😈

u/GaramChandraGandhi — 6 days ago
▲ 1 r/MacOS

Bash 3.2 alternative to read -i for prefilled user input on macOS

Hi everyone,

I have a script that works fine on Linux with Bash 4.x+, where I use read -e -i to prefill existing values and allow the user to edit them:

case "$vals" in

b|B) echo -ne " ${CYAN}Bsl${RESET}: " read -e -i "$bsl" -r bsl ;;

t|T) echo -ne " ${CYAN}Term${RESET}: " read -e -i "$term" -r term ;;

s|S) echo -ne " ${CYAN}Site${RESET}: " read -e -i "$site" -r site ;;

c|C) echo -ne " ${CYAN}Capt${RESET}: " read -e -i "$capt" -r capt ;;

esac

However, on macOS (which ships with Bash 3.2), I get:

read: -i invalid option

read: usage: read \[-ers\] \[-u fd\] \[-t timeout\] \[-p prompt\] \[-a array\] \[-n nchars\] \[-d delim\] \[name ...\]

From what I understand, the -i option was introduced in Bash 4+.

Is there any portable workaround or alternative way to present a default/prefilled value to the user in Bash 3.2 while still allowing them to edit it interactively?

I'd appreciate any suggestions or examples that work on both Linux and macOS.

Thanks!

reddit.com
u/GaramChandraGandhi — 11 days ago
▲ 8 r/bash+1 crossposts

Bash 3.2 alternative to read -i for prefilled user input on macOS

Hi everyone,

I have a script that works fine on Linux with Bash 4.x+, where I use read -e -i to prefill existing values and allow the user to edit them:

case "$vals" in

b|B) echo -ne " ${CYAN}Bsl${RESET}: " read -e -i "$bsl" -r bsl ;;

t|T) echo -ne " ${CYAN}Term${RESET}: " read -e -i "$term" -r term ;;

s|S) echo -ne " ${CYAN}Site${RESET}: " read -e -i "$site" -r site ;;

c|C) echo -ne " ${CYAN}Capt${RESET}: " read -e -i "$capt" -r capt ;;

esac

However, on macOS (which ships with Bash 3.2), I get:

read: -i invalid option read: usage: read [-ers] [-u fd] [-t timeout] [-p prompt] [-a array] [-n nchars] [-d delim] [name ...]

From what I understand, the -i option was introduced in Bash 4+.

Is there any portable workaround or alternative way to present a default/prefilled value to the user in Bash 3.2 while still allowing them to edit it interactively?

I'd appreciate any suggestions or examples that work on both Linux and macOS.

Thanks!

reddit.com
u/GaramChandraGandhi — 11 days ago