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 / python, shell, julia-evans

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 / shell, zsh

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 / python, shell

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 / bash, shell, 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 / bash, shell, shunit2, testing, unittesting, unix, xunit

2007

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

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

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

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