Top all-time · #1475
amoffat.github.io
Personal blog · amoffat.github.ioprogramming
amoffat.github.io is a personal blog at amoffat.github.io about programming. Since 2013, 51 different Hacker News readers have linked it 77 times, most often “Sh: Python library that allows you to call any program as if it were a function”. No feed was found, so read it on the site itself.
Most-linked posts?
- Sh: Python library that allows you to call any program as if it were a function24 people · 31 mentions · first linked 2014-05-31
- /sh/14 people · 14 mentions · first linked 2013-05-17
- Show HN: Reimagine the File System5 people · 8 mentions · first linked 2020-11-30
- Reducing the cognitive load of AI changes3 people · 4 mentions · first linked 2026-10-01
- Vetted AI code is hard to justify3 people · 3 mentions · first linked 2026-08-17
What Hacker News says?
I'm loving this trend to do more things with filesystems. There was https://amoffat.github.io/supertag/ [,] which I'm intending to use in my filesharing sftp server, and now this, which seems like something that exposes functionality from a web browser that I would love.
Comment linking /supertag/
on “TabFS: Mount your Browser Tabs as a Filesystem”Submitted Show HN: Reimagine the File System as a story · 49 points
HN discussionTry python "sh" https://amoffat.github.io/sh It's pretty elegant. import sh sh.bar(sh.foo())
Comment linking /sh
on ““It's The Future””Submitted Why is it called a Fibonacci Heap? as a story · 5 points
HN discussionYou might like the python "sh" library [0]. It's not perfect, but it sure does remove the visual noise around subprocess. [0] https://amoffat.github.io/sh/
Comment linking /sh/
on “Pure Bash Bible”Submitted Sh: Python library that allows you to call any program as if it were a function as a story · 5 points
HN discussionTake a look at this, as well: https://amoffat.github.io/sh/
Comment linking /sh/
on “Bash 5.0 released”Submitted Shell Scripting support for Python as a story · 5 points
HN discussionsh.py leverages this in command baking http://amoffat.github.io/sh/#baking
Comment linking /sh/
on “Unix Commands I Wish I’d Discovered Years Earlier”Submitted Reducing the cognitive load of AI changes as a story · 3 points
HN discussionI'd go as far as saying "having more than a dozen lines". Bash syntax for anything other than basic execution and piping a few commands, is a disaster IMHO. Anything that requires logic should be written in a "real" scripting language. Python is my choice when I need a bit of logic in my scripts, but it's just a personal choice of course. A good addition for simplifying execution is the "sh" library that lets you ca…
Comment linking /sh/
on “Better bash in 15 minutes”Submitted Show HN: Solve the Travelling Salesman Problem with the GPU as a story · 3 points
HN discussionI've been migrating shell scripts to python and have found the 'sh' library invaluable for pulling in pure CLI commands from the bash script and adding to the python implementation. http://amoffat.github.io/sh/ It's essentially an abstraction layer above subprocess. Quick example - to use ifconfig natively in python: from sh import ifconfig print(ifconfig("wlan0"))
Comment linking /sh/
on “Help Message for Shell Scripts”Submitted WebGL Solver for the Travelling Salesman Problem as a story · 3 points
HN discussion> Trying to use Python or Go to whack some external commands together feels very cumbersome to me. Try https://amoffat.github.io/sh/ from sh.contrib import git git.reset(hard=True)
Comment linking /sh/
on “What was the point of [ “x$var” = “xval” ]?”Submitted Reducing the cognitive load of AI changes as a story · 2 points
HN discussionI've had good luck with this module. Much nicer than using os.system() imo. https://amoffat.github.io/sh/
Comment linking /sh/
on “Why Create a New Unix Shell?”Submitted Reducing the cognitive load of AI changes as a story · 2 points
HN discussionI wrote sh for this very reason http://amoffat.github.io/sh/ This lets you use a programming language, instead of a shell language, to solve programming tasks.
Comment linking /sh/
on “Bash Academy”Submitted Python “Sh” Module as a story · 2 points
HN discussionhttps://amoffat.github.io/sh/
Comment linking /sh/
on “Not Your Grandfather’s Perl”Submitted Supertag is a tag-based file system, written in Rust as a story · 2 points
HN discussioncool! shameless self-promotion, I wrote a similar thing for a blog post travelling salesman in js+gpu: https://amoffat.github.io/held-karp-gpu-demo/ gpgpu.js: https://github.com/amoffat/gpgpu.js
Comment linking /held-karp-gpu-demo/
on “Gpu.js – GPU Accelerated JavaScript”Submitted Travelling Salesman solver with WebGL as a story · 2 points
HN discussionThe sh module is really excellent, and it lets you take the best parts of bash (the external commands, pipes) and ditch the bad parts (string handling, general programming). I think it’s what you’re looking for. https://amoffat.github.io/sh/
Comment linking /sh/
on “I got tired of PHP and Perl, so I tried bash”Submitted Reducing the cognitive load of AI changes as a story · 1 points
HN discussionBy python-sh do you mean http://amoffat.github.io/sh/ ?
Comment linking /sh/
on “Hy – A dialect of Lisp that’s embedded in Python”Submitted Vetted AI code is hard to justify as a story · 1 points
HN discussion[sh.py]: https://amoffat.github.io/sh/
Comment linking /sh/
on “Show HN: Pyp – Easily, magically, run Python at the shell”Submitted Vetted AI code is hard to justify as a story · 1 points
HN discussion