3 ms·
Some goodies for POSIX sh programmers: * readlink/realpath (https://austingroupbugs.net/view.php?id=1457 https://austingroupbugs.net/view.php?id=1457) * find
by a-french-anon 2y ago
Some goodies for POSIX sh programmers:
* readlink/realpath (https://austingroupbugs.net/view.php?id=1457 https://austingroupbugs.net/view.php?id=1457)
* find -print0, xargs -0 and read -d (https://austingroupbugs.net/view.php?id=243 https://austingroupbugs.net/view.php?id=243)
* find -iname (https://austingroupbugs.net/view.php?id=1031 https://austingroupbugs.net/view.php?id=1031
* sed -E (https://austingroupbugs.net/view.php?id=528 https://austingroupbugs.net/view.php?id=528)
* set -o pipefail (https://austingroupbugs.net/view.php?id=789 https://austingroupbugs.net/view.php?id=789)
- clausecker 2y agoAlso c17 -G to create shared objects, SIGWINCH and tcgetwinsize() to query the size of a terminal window, lots of new shell features, make is now somewhat useful, gettext() and associated commands are in, asprintf(), C17 support, strlcpy, strlcat, and many more all new and exciting features.
- a-french-anon 2y agoasprintf is a pretty cool one. https://frippery.org/make/2024.html https://frippery.org/make/2024.html details some of the make changes.
- thechao 2y agoasprintf is a nice toy, but it should really take a context and a "realloc" function pointer to be useful, in general. Here's hoping for 2040!
- tedunangst 2y agoHow many other posix functions take allocators?
- cperciva 2y agoc17 -G to create shared objects Finally! It always seemed very strange to me that posix said that shared objects were a thing and provided a rtld API for using them, but never specified how to create them.
- nwellnhof 2y agoI'm most excited about getentropy().
- dwheeler 2y agoI agree! You can blame me for some of those proposals :-), my thanks to the POSIX team for getting this out the door. The sed -E option makes it easy to portably use extended regular expressions. The find -print0, xargs -0, and read -d provide portable ways to securely process lists of files. They were already widely implemented, but now they're officially part of the spec and can be counted on being present in many other places.
- stephenr 2y agoThanks, those will indeed be useful. Looks like `pipefail` is already in Dash https://salsa.debian.org/debian/dash/-/blame/debian/unstable/debian/changelog?ref_type=heads#L24 https://salsa.debian.org/debian/dash/-/blame/debian/unstable...
- EuAndreh 2y agowow, I just realized you're the same dwheeler from the work on diverse double-compilation! Thanks for the improvements on POSIX, I've read many issues and discussions raised by you in the past couple of years. If fact, I think it was one of yoir comments on make(1)'s dynamic dependency graph that reassured me I had a correct grasp on its execution model!
- dwheeler 2y agoThanks so much, that means a lot.
- casey2 2y agoI for one am overjoyed that i can now type readlink instead of invoking a shell script. I know newbies will also be overjoyed now that they can just read a LLONG_MAX page manual containing the solution to all their problems
- jwilk 2y agoAlso $'…' strings: https://austingroupbugs.net/view.php?id=249 https://austingroupbugs.net/view.php?id=249
- mathfailure 2y agoBut `find -iname` always worked; why was it proposed again?
- BoingBoomTschak 2y ago??? It wasn't standardized before, so it didn't "always work" on any implementation.