Conversation
Notices
-
m (meeper@outerheaven.club)'s status on Wednesday, 09-Jun-2021 11:51:08 JST m yep so only xargs supports null terminated strings, so no fancy for loops? -
mia (mia@movsb.0x0.st)'s status on Wednesday, 09-Jun-2021 11:50:56 JST mia @meeper yeah, one of the reasons i prefer shells like zsh and fish is that they have safer type/glob handling out of the box than e.g. bash, and you don’t have to jump through hoops to safely handle file lists バツ子(痛いの痛いの飛んでけ;; likes this. -
m (meeper@outerheaven.club)'s status on Wednesday, 09-Jun-2021 11:50:57 JST m @mia not really doing anything, but I was seeing if there is a robust way to work with lists of files (which can have newlines embedded for some reason)and the only decent way is null terminated lists with find -0 and xargs -0I think rich felker also demonstrated an intereresting solution using .// instead of ./ (/ is not allowed in filenames so you can possibly use it to differenciate new files) -
mia (mia@movsb.0x0.st)'s status on Wednesday, 09-Jun-2021 11:50:59 JST mia @meeper complete waste of time imo, but have fun if that’s what you’re going for -
m (meeper@outerheaven.club)'s status on Wednesday, 09-Jun-2021 11:51:00 JST m @mia Yeah true, I was just curious if posix sh supported something that can be robust "in a pinch" it's a mess ikr -
mia (mia@movsb.0x0.st)'s status on Wednesday, 09-Jun-2021 11:51:03 JST mia @meeper i treat POSIX shell the same as microsoft batch. is batch a good choice for your task? if not, don’t use posix sh either. -
m (meeper@outerheaven.club)'s status on Wednesday, 09-Jun-2021 11:51:05 JST m @mia POSIX shell sucks and commands only output to strings so no object types; I wanna make a suite of shell utils that do output stuff in proper arrays and have stuff to handle that -
mia (mia@movsb.0x0.st)'s status on Wednesday, 09-Jun-2021 11:51:07 JST mia @meeper why use null-terminated strings when you can use proper array types -
バツ子(痛いの痛いの飛んでけ;; (shmibs@tomo.airen-no-jikken.icu)'s status on Wednesday, 09-Jun-2021 11:57:18 JST バツ子(痛いの痛いの飛んでけ;; @mia @meeper lots of little-nice-things in zsh, is actually really pleasant to work with for bigger scripts, feels like writing elixir kinda, all the pipes and message passing processes
&& and || super useful also, like
[[ $#@ -ne 1 ]] && printf "Usage: %s <pos_int>\n" $0 && return 0prefer to anything like python or whatever
-