Some middle-aged guy on the Internet. Seen a lot of it, occasionally regurgitating it, trying to be amusing and informative.

Lurked Digg until v4. Commented on Reddit (same username) until it went full Musk.

Was on kbin.social (dying/dead) and kbin.run (mysteriously vanished). Now here on fedia.io.

Really hoping he hasn’t brought the jinx with him.

Other Adjectives: Neurodivergent; Nerd; Broken; British; Ally; Leftish

  • 0 Posts
  • 1.05K Comments
Joined 2 years ago
cake
Cake day: August 13th, 2024

help-circle

  • I’m going to assume you’re not kidding, in which case, no, I mean the first letter of the command name it was called by.

    There are already commands that do this. For example, on my machine, ex is the head of a symlink chain that leads to the vim text editor’s executable and if I run ex, vim will know that it was started with the name ex and will start in ex mode. ex was an editor that worked in a different way but was vim’s ancestor, so backwards compatibility is built right in for those strange people who love ex, (or have some kind of automation reliance on it being present).

    Usually, the main command has a command line option that achieves the same effect as the special name. Here, vim -e is the less clever way to start vim in ex mode.

    For yes, symlinking the name no to it and then calling that should arguably cause it to print n repeatedly, but it doesn’t, for historical reasons, hence my suggestion to go back in time and make it act differently.

    (None of this touches on the fact that the GNU philosophy wants nothing to do with clever tricks like this. They prefer to compile separate executables for each and every use case. For example, most Linuxes have dir and vdir as variants of the ls command. Their functionality could have been implemented through this symlink trick, but instead there are three near-identical executables taking up space instead.)




  • The two commands are not equivalent. sed 11q prints 11 lines whereas head’s default is 10.

    Personally I would prefer head -11 in this situation as it more clearly indicates, for the sake of the meme, that something is being removed from the head.

    There’s also that head seems to be ever-so-slightly quicker, perhaps proving what we already knew about thinking being quicker than speech.

    TL;DR That’s what she sed?


  • The BeOS command line command set were all borrowed from or based upon Unix and/or Linux (IIRC many were straight from GNU), which is the basis for my comparison.

    The kernel and graphics were all from-scratch and radically different from Linux, sure, but the same could be said of Linux when compared to the original Unix, or any of the BSDs.














  • $ yes n
    n
    n
    n
    n
    n
    n
    ...
    

    I kind of want to go back in time and make it so that the original yes always printed the first letter of the name it was called by. That way you could symlink any name you like to it and it would do the right thing. Called as no it would print ns, etc. The optional parameter would still be there for longer strings or alternate uses.

    The reason time travel would be needed is that there’s bound to be, or have been, someone who has done something weird regarding symlinking yes that relies on it always printing y when it has no parameter, and the name trick would be a breaking change.