4mitkumar 42 minutes ago

Oooh..reminds me of something similar I did earlier for own blog a few years back: https://github.com/proxygeek/publish/

I have moved away to Jekyll again but there's always something alluring about single file things - single file webapps, single file LLMs (llamafile) and others

hyperionultra 5 hours ago

Mmm, good ol’ bash. I like it.

  • IshKebab 3 hours ago

    Awful old Bash. I hate it.

    Seriously I don't know why you'd do this in Bash. Crazy choice.

    • Hendrikto 3 hours ago

      Some people like to claim that using a pretty esoteric language with lots of weird footguns, lack of basic features and data types, and spawning subprocesses for everything, is somehow keeping it simple.

      I do not understand them.

      • t-3 37 minutes ago

        Weird footguns don't matter if you stick to using shell for control flow, composition, and interpolation, and don't use all the weird things you have to look up every time. It's also very easy to do something in the commandline then just

          tail -n 8 $HISTFILE > script.sh
        

        and very little to no editing is needed to make that useful. Shell is not a programming language, it's an interface to the OS, and thinking about it like a programming language is just asking for frustration.

      • barrotes 36 minutes ago

        I honestly think that's the contrary: it's the laziest choice possible when you want something to work immediately without thinking too much about it. Till like 7 years ago I made literally every script to do "personal" stuff in bash, because I wasn't quite good with any programming language and bash... was just there in my Linux machine, and I was already familiar with it because I was a long time Linux user. Sometimes you end up committing it on github and people start issuing feature requests, and at the beginning you are just happy that your work fits the need of other people and you don't want to rewrite it from scratch with a better programming language and end up over-scripting it. That's basically the story of a little program I made years ago. Now I don't log in on github anymore because I'm afraid people is still requesting new features...

    • PaulRobinson 3 hours ago

      Known system dependency that's (almost) always on the system you're on.

      I remember somebody once telling me that they had learned vi because "it was always installed". Well, no, technically, the only editor you can be sure is there is ed. So, you know, learn that. I was surprised that they actually did.

      Bash is syntactically not perfect, I agree. However it's a well known, mature, stable environment. LLMs can write it well if you need them to. If it was perfect, we'd never have had Perl, and as a result we'd never have had Ruby, Python and other scripting languages.

      But I like it's a tool that doesn't require me to go reach for a package manager and some build tools I don't always have on every system.

      • StilesCrisis 1 hour ago

        Who's updating their blog from a random machine without Python on it, though?

        • Jhsto 43 minutes ago

          I'd presume it's quite common with NixOS. At least I don't have python linked to my environment. It might be different would I use the REPL, but I do not, so for me python is a program (or script) dependency, not something I need to carry around. It's actually quite common for many setup scripts to fail when python is not installed, but not all of them list python as a dependency either.

      • afandian 1 hour ago

        I’ve been down this path (it was a script for scraping and extracting text). You write your text utility in bash. It works. Then you need a regex so you use sed.

        Then you wonder why it doesn’t work in your other environment. Then you find that GNU vs BSD sed have different syntax.

        Better to start with Python once you’re doing more than coordinating well known other tools.

    • raphinou 2 hours ago

      It probably started as a helper script and grew from there. The script seems quite focused and doesn't grow, so a rewrite might not be warranted.

      It also has no other dependency, which is also good. I have written helper script to run coding agents in a container. And you guessed it, it's in bash. For the reasons I just wrote down. Should it have to grow I would rewrite it, but not currently.

hkt 4 hours ago

Glorious.

I used a similar system back in the day, nanoblogger:

https://nanoblogger.sourceforge.net/

  • k3vinw 1 hour ago

    Awesome! I’m the author and I created that project as a way to teach myself Bash at the time. I called it NanoBlogger because it was inspired by MicroBlogger, yet another Bash blog.

    I still have fond memories of the open source community’s warm welcome and amazing contributions to the project.

chiply314 3 hours ago

Its time to invent something lightweight and good which runtime is so small that it becomes a system default.

like a microvm with normal language features. Something you can and want to actually attach a debugger onto it. Something independent of architecture too.

I just hate bash :| Even just using bash and curl and checking if its a website or an error page...

  • nicbou 3 hours ago

    I use Python for that, since I know it will always be on my machine.

    Is this what you have in mind?

    • chiply314 2 hours ago

      Yeah but i have Python PTSD from all this Python 2 vs. 3 shit :D

      • microtonal 1 hour ago

        I'm sure that there are still Python 2 codebases there running an unsupported interpreter, but for most people that has been at least 5-10 years ago. Also, the Python project learned a lot from the messy transition, that I think it's unlikely to happen again.

        • chiply314 57 minutes ago

          And then some old debian box comes out of shadow.

          I'm sure that ubuntu LTS also extended the life of this disaster + some tool you wanted to use which never upgraded.

          GNU Radio took ages

      • tomwojcik 1 hour ago

        That was almost 20 years ago! We migrated 2 to 3 10 years ago. I'd say I moved on. I doubt there will ever be py4 :)

      • edoceo 1 hour ago

        Perl still loves you and will always be there.

  • XorNot 2 hours ago

    Go has a fast enough compile speed I feel like you could syntactically sugar it to be a command line.

    • chiply314 2 hours ago

      Yeah but its not scripty enough and has not enough easy stuff build in.

      • hiyfsch 2 hours ago

        https://www.tcl-lang.org/

        Many people have made micro Tcl’s too if you want something even lighter.

        It has a built in subst command no need for a template engine!

  • rohitkg98 2 hours ago

    exe.dev does a pretty good job of instantly deployable microVMs

  • speq 2 hours ago

    Nim might be an option. It even has a subset to be used for scripting purposes.

  • cfiggers 55 minutes ago

    It's definitely not a system default (unless it's a system I've had access to for more than ten minutes!), but:

    I use Janet[0] for this.

    [0] https://janet-lang.org

_ache_ 3 hours ago

I used to do that. Them move to a NodeJS script.

Because bash is maybe worst than C for this task.

iLoveOncall 36 minutes ago

Nice idea but I don't understand why people write bash scripts more than a few lines long.

There's absolutely 0 advantage, especially when AI can write simple code like that easily, over using any other language. It makes reading and maintaining much more complex.

Hell, even GitHub's syntax highlighting (and VS Code's) breaks in many places throughout the script. It's just a terrible developer experience, even for your own scripts that nobody else will ever touch.

Some people will say that the advantage is that you don't need to install another runtime, but even this is wrong as the script uses bash, not sh.

I hate Python with a passion, but I'd gladly take it over bash for any of those scripts.

  • jon-wood 20 minutes ago

    Bash is the wrong choice for truly complex software but I still find it really hard to pick anything else for the sort of tasks where I'm mostly manipulating text files and shelling out to other tools. My general instinct for when its time to reimplement a script in Python or similar is when I've got a ton of conditionals or function calls, at that point its also time to start writing unit tests.

    shellcheck is a huge help in the middle sized shell script space and will regularly shout at me about missing all the random gotchas like not quoting file paths.

bluebarbet 4 hours ago

This is a good example of a program I would like to use if it was distributed in the standard repo of my OS, rather than totally unvetted on the Microsoft Github page of a random developer.

PS: I don't know why HN allows downvoting seeing how it is always so abused. Nothing I wrote here is factually false, and what remains is just my personal opinion as a principled user of FOSS. A bit of tolerance for others' viewpoints is in order.

  • yolkedgeek 3 hours ago

    What? That's how open source works

    • mikae1 3 hours ago

      Package management in the distro is also how FOSS works?

      • dspillett 2 hours ago

        Things that end up in curated package repositories like those of the various significant distros, have usually spent time growing on the random developer's own page (most common in the past) or said random developer's account on a forge like github (most common in more modern times).

        Standard repos might be were many discover things, but those things don't normally get there until they've build a following, so the random developers page is the more significant vector overall.

        • bluebarbet 1 hour ago

          Fair enough. It would be nice if more developers would at least consider using the forges that don't belong to an ethically compromised big-tech oligopolist. The options are there.

  • feelamee 2 hours ago

    for what we need downvoting and upvoting? I thought: - upvote if you like/agree - downvote if you dont like/disagree Am I wrong?

    • bluebarbet 2 hours ago

      This reads like parody! In a sane world (and I believe the HN community rules are fairly sane) we should be upvoting things that are interesting, or insightful, or informative, or otherwise tickle our curiosity. Not just because we agree with them! After all, who cares that I agree with something? Everyone has an opinion on everything, opinions in themselves are cheap and uninteresting.

      • StilesCrisis 1 hour ago

        It's not interesting or insightful to take potshots at a project because it's hosted on GitHub.

        • bluebarbet 1 hour ago

          It's downright intolerant to downvote (as opposed to not upvote) a comment which simply advocates values in line with FOSS. I even said I would like to use this program.

  • mystifyingpoi 1 hour ago

    > This is a good example of a program I would like to use if it was distributed in the standard repo of my OS

    So why are you waiting? Be the change you seek. Simply become a maintainer of a distro, and publish the package there. Repeat for all the major distros.