Simon Willison’s Weblog

Subscribe
Atom feed for shell

8 items tagged “shell”

2024

PATH tips on wizard zines (via) New Julia Evans comic, from which I learned that the which -a X command shows you all of the versions of that command that are available in the directories on your current PATH.

This is so useful! I used it to explore my currently available Python versions:

$ which -a python    
/opt/homebrew/Caskroom/miniconda/base/bin/python
$ which -a python3
/opt/homebrew/Caskroom/miniconda/base/bin/python3
/Library/Frameworks/Python.framework/Versions/3.13/bin/python3
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3
/opt/homebrew/bin/python3
/usr/local/bin/python3
/usr/bin/python3
/Users/simon/Library/Application Support/hatch/pythons/3.12/python/bin/python3
/Users/simon/Library/Application Support/hatch/pythons/3.12/python/bin/python3
$ which -a python3.10
/opt/homebrew/Caskroom/miniconda/base/bin/python3.10
/opt/homebrew/bin/python3.10
$ which -a python3.11
/opt/homebrew/bin/python3.11
$ which -a python3.12
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12
/opt/homebrew/bin/python3.12
/usr/local/bin/python3.12
/Users/simon/Library/Application Support/hatch/pythons/3.12/python/bin/python3.12
/Users/simon/Library/Application Support/hatch/pythons/3.12/python/bin/python3.12
$ which -a python3.13
/Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13
/opt/homebrew/bin/python3.13
/usr/local/bin/python3.13

# 15th October 2024, 3:25 pm / shell, julia-evans, python

Shell History Is Your Best Productivity Tool (via) Martin Heinz drops a wealth of knowledge about ways to configure zsh (the default shell on macOS these days) to get better utility from your shell history.

# 10th April 2024, 11:17 pm / zsh, shell

2020

pyp: Easily run Python at the shell (via) Fascinating little CLI utility which uses some deeply clever AST introspection to enable little Python one-liners that act as replacements for all manner of pipe-oriented unix utilities. Took me a while to understand how it works from the README, but then I looked at the code and the entire thing is only 380 lines long. There’s also a useful --explain option which outputs the Python source code that it would execute for a given command.

# 9th May 2020, 9:05 pm / shell, python

2017

direnv (via) A shell extension (for bash, zsh and others) which can automatically set and unset environment variables when you cd into specific directories. Useful for managing things like a project’s GOPATH or automatically activating Python virtual environments.

# 5th November 2017, 7:59 pm / shell, bash, zsh

2012

What is a good programming language to learn after bash scripting?

Python is a good natural progression from bash in my opinion. It has an interactive prompt which supports bash-style exploratory programming, and it has libraries that mean it can be applied to an enormous range of problems—everything from game development to scientific computing to web applications.

[... 65 words]

2009

shunit2 (via) xUnit style testing for shell scripts.

# 27th September 2009, 7:34 pm / unittesting, testing, bash, shell, unix, xunit, shunit2

2007

Insert Dojo and YUI bookmarklets. Combine with Jash for interactive API experimentation on any web page.

# 9th December 2007, 12:38 pm / shell, jash, dojo, yui, javascript, bookmarklets, gareth-rushgrove

Jash: JavaScript Shell (via) An advanced JavaScript interactive shell bookmarklet that works in IE, Firefox, Opera and Safari.

# 9th December 2007, 12:36 pm / gareth-rushgrove, jash, javascript, ie, firefox, opera, safari, bookmarklet, shell