The best bash script of the year.
Conversation
Notices
-
Ekaitz Zárraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Tuesday, 14-Jun-2022 16:57:33 CEST Ekaitz Zárraga 👹 -
Efi (nap pet) 🐱💤 (efi@chitter.xyz)'s status on Tuesday, 14-Jun-2022 17:00:24 CEST Efi (nap pet) 🐱💤 @ekaitz_zarraga isn't there a better way to chech paths? pretty sure [[ has flags for that
-
Ekaitz Zárraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Tuesday, 14-Jun-2022 17:00:24 CEST Ekaitz Zárraga 👹 @efi I'm complaining, I didn't write this.
First, [[ is a bashism, so it's better to go just for [ (which is `test`, but come on... it looks better if you use the [), and sure, there are better ways to check strings... they use the x"" trick which is one of the worst tricks ever
-
ruffni@mstdn.io's status on Tuesday, 14-Jun-2022 17:02:18 CEST ruffni @ekaitz_zarraga i stumbled over this today too (in U-Boot, so Hush). i guess this catches empty strings
-
Ekaitz Zárraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Tuesday, 14-Jun-2022 17:02:18 CEST Ekaitz Zárraga 👹 @ruffni sure that's the goal! but there are better ways to do that I think...
-
Ekaitz Zárraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Tuesday, 14-Jun-2022 17:53:55 CEST Ekaitz Zárraga 👹 @ruffni [ -z $VAR ] ?
-
ruffni@mstdn.io's status on Tuesday, 14-Jun-2022 17:53:56 CEST ruffni @ekaitz_zarraga i'm listening...?
-
Ekaitz Zárraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Tuesday, 14-Jun-2022 18:22:05 CEST Ekaitz Zárraga 👹 @ruffni I mean: man test ftw
-
ruffni@mstdn.io's status on Tuesday, 14-Jun-2022 19:58:46 CEST ruffni @ekaitz_zarraga they are not equivalent, though. if $VAR is not defined in the env, then `test -z $VAR` returns 0, but `test "" = $VAR` fails completely, which can be desirable
-
Ekaitz Zárraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Tuesday, 14-Jun-2022 20:03:04 CEST Ekaitz Zárraga 👹 @ruffni and but in any case the x"" is needed? there's no other fucking way?
has to be -
ruffni@mstdn.io's status on Tuesday, 14-Jun-2022 21:27:26 CEST ruffni @ekaitz_zarraga i smell legacy
-
Ekaitz Zárraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Tuesday, 14-Jun-2022 21:27:26 CEST Ekaitz Zárraga 👹 @ruffni yeah, it's the old way to do it, that's why I was mentioning this
-