elvish-unix(7)
π elvish-unix(7) β Miscellaneous Information Manual π
okay bestie, welcome to the unix: module glow-up β¨ this is the manual page for it, and it's literally so much fun, no cap.
πΈ Introduction πΈ
The unix: module is giving you access to features that only make sense on UNIX-like operating systems β think Linux, FreeBSD, and macOS. π§π¦
Now, on non-UNIX operating systems, like MS Windows, this namespace straight up does not exist, and use unix will fail. π Not a vibe.
So how do you vibe-check it first? Easy β use the $platform:is-unix variable to figure out if this namespace is even usable. Iconic. π
β¨ Variables β¨
π $unix:umask {#unix:umask} π
This is the file mode creation mask, periodt. Its value is a string in Elvish octal representation β e.g. 0o027 π. The way this slaps is that it makes it possible to use it in any context that expects a $number. π
When you assign a new value, a string is implicitly treated as an octal number. If that fails, the usual rules for interpreting numbers are used. So these two are literally equivalent:
unix:umask = 027
unix:umask = 0o27
You can also assign to it a float64 data type that has no fractional component. π§ The assigned value must be within the range [0 ... 0o777] β otherwise the assignment will throw an exception. π
You can also do a temporary assignment to affect a single command, like:
umask=077 touch a_file
After the command completes, the old umask will be restored. π«Ά
β οΈ Warning: Since the umask applies to the entire process, not individual threads, changing it temporarily in this manner is dangerous if you are doing anything in parallel. Such as via the peach command. π fr fr, be careful.
and that's the whole page, bestie!! π this was Elvish 0.17.0, dated Nov 18, 2024 β go forth and umask responsibly πβ¨
π¦ where this page comes from
- ubuntu jammy: elvish 0.17.0-1ubuntu0.1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms