Posts

Showing posts with the label unix

version names are like version numbers, in the same way that monkeys are like humans

Image
In investigating why I can't `mkdir /scratch` on MacOS, I came across:     With macOS Catalina, you can no longer store files or data in the read-only system volume, nor can you write to the "root" directory [...] [0] The phrase "you can no longer [..]" suggests a linear progression.  Some kind of ordering.  Comparability. If "you can no longer" in 3.5, then probably in 2.7 you can, whereas in 3.6 you can not.  Version names do not have this.  Why does everything from debian to ubuntu to, apparently, MacOS, suffer from this same bad meme?  Why does my sources.list contain "deb-src http://deb.debian.org/debian/bullseye main non-free contrib"?  Is that before or after that other disney character? At least Apple has resisted the temptation, apparently irresistible to others, to name their thing after irritating combinations of adjective and animal name, such as "spastic spider".  Oh, remind me, did "gay goat" come before or ...

foreground-to-background in one go

In a Unix shell, you can background a command with an '&'.  If it's running in the foreground, you can suspend it with ctrl-Z, and then background (unsuspending it) with the "bg" built-in shell command. That's nice, but even nicer would be if you could do it one go.  Foregrounded to backgrounded in one go doesn't sound like too much to ask, and seems like an obvious idea. I don't see any need for (Unix) signals in the new feature.  Suspend involves a signal, but we are not doing the suspend.  Is there a ctrl-something available for the user interface?  Do we need to involve the terminal (emulator), or can this just be done in the shell?  Is it already a feature that I don't know about in some shell, or has anyone done it as a demo?  Those are all the questions I can think of. Incidentally, I've been wondering about trying some pair-working mini projects, defined as: in the first 3 days, set objectives so that the two of you can, with 95% pr...

why are there stupid files in my nfs-exported directory?

There's one file in the (nfs-exported) directory. Why isn't tab-complete working in the shell? Answer: because the nfs server has put a silly file there called ". nfs00000000008814aa00000002 ".  That's why auto-complete can't work.  No, you can't have nice things.

why do shebangs contain complete paths?

Why do scripts' shebang lines contain something like: #!/bin/sh and not (say): #!sh ? No real reason.  The latter would be better.  shebang lines are not specified in POSIX, at all.  There is nothing stopping a Unix vendor from defining a system PATH (indeed, it's apparently supposed to be via getconf("PATH") in general) which is searched for unqualified interpreter names in shebang lines.  Just document it in the system manual, please.  The real reason it hasn't happened is that nothing has happened in Unix for 25 years. Before you say "but the linux kernel executes shebangs, and the kernel can't just go calling getconf() and such", any such distinction between kernel and userspace is, from a Unix point of view, an internal implementation matter, and thus no excuse for anything.  The system, as a whole, should sort things out, and if the system spec were to say that unqualified shebang lines shall be interpreted according to the PATH from getconf()...

minimal systemd "unit" file

 I used to use daemontools for running servers under process supervision.  There are other similar systems like runit. Now, most current linux distributions use systemd.  This is presented as a disaster by purists, but the fact is, everyone else failed to make anything adequate while systemd crept up.  Unix has a process tree, so use it.  Instead of which, every shonky init script had its own error-prone concoction of pid files, daemon that backgrounds itself, commands like "stop" or "reload" that LOOK AT THE PID FILE and send it a signal.  As a side-whinge, most daemons automatically go thru a cargo-cult absurdity of detach and fork and background, or whatever the fuck it is.  A lot of the time, you can ask them not to do this, often with arcane options (look at apache: -DFOREGROUND -DNO_DETACH ).  It should not even be possible, let alone some default the long-suffering sysadmin has to work around, differently for each application.  The peo...

shell feature: auto-complete with newest file in current directory

 Often in a shell, one wants to do something with the newest file in the current working directory. Tab already completes on partial names in many interactive shells including bash. The idea here is to have a shortcut to autocomplete on the file with the highest ctime in the directory.  The action of "doing something to that file you just created" then becomes more convenient. As for user interface, is shift-tab available in bash et al?