New post: shell tricks that aren't exactly secret, but aren't always taught either.
-
New post: shell tricks that aren't exactly secret, but aren't always taught either.
Split into two sections: what works on any POSIX sh (FreeBSD, OpenBSD, Alpine...) and what's Bash/Zsh-specific. Because not everyone is on Linux with bash as their login shell.
Things like CTRL+W, $_, pushd/popd, fc, set -euo pipefail caveats, and more.
Shell Tricks That Actually Make Life Easier (And Save Your Sanity)
Watch someone backspace 40 characters instead of pressing CTRL+W, and you’ll understand why this list exists. A collection of shell tricks-grouped by what wo...
Larvitz Blog (blog.hofstede.it)
-
New post: shell tricks that aren't exactly secret, but aren't always taught either.
Split into two sections: what works on any POSIX sh (FreeBSD, OpenBSD, Alpine...) and what's Bash/Zsh-specific. Because not everyone is on Linux with bash as their login shell.
Things like CTRL+W, $_, pushd/popd, fc, set -euo pipefail caveats, and more.
Shell Tricks That Actually Make Life Easier (And Save Your Sanity)
Watch someone backspace 40 characters instead of pressing CTRL+W, and you’ll understand why this list exists. A collection of shell tricks-grouped by what wo...
Larvitz Blog (blog.hofstede.it)
@Larvitz I recently learned a funny trick from Kirils Solovjovs in a bash workshop. He had in his path a script called `\#` that he used to comment out pipe elements like `mycmd1 | \# mycmd2 | mycmd3`. This was how the script was written:
```
#!/bin/sh
cat
``` -
New post: shell tricks that aren't exactly secret, but aren't always taught either.
Split into two sections: what works on any POSIX sh (FreeBSD, OpenBSD, Alpine...) and what's Bash/Zsh-specific. Because not everyone is on Linux with bash as their login shell.
Things like CTRL+W, $_, pushd/popd, fc, set -euo pipefail caveats, and more.
Shell Tricks That Actually Make Life Easier (And Save Your Sanity)
Watch someone backspace 40 characters instead of pressing CTRL+W, and you’ll understand why this list exists. A collection of shell tricks-grouped by what wo...
Larvitz Blog (blog.hofstede.it)
@Larvitz I often use "Meta+." (in your config: ALT+. I guess) to get the last argument of the last executed command.
-
New post: shell tricks that aren't exactly secret, but aren't always taught either.
Split into two sections: what works on any POSIX sh (FreeBSD, OpenBSD, Alpine...) and what's Bash/Zsh-specific. Because not everyone is on Linux with bash as their login shell.
Things like CTRL+W, $_, pushd/popd, fc, set -euo pipefail caveats, and more.
Shell Tricks That Actually Make Life Easier (And Save Your Sanity)
Watch someone backspace 40 characters instead of pressing CTRL+W, and you’ll understand why this list exists. A collection of shell tricks-grouped by what wo...
Larvitz Blog (blog.hofstede.it)
@Larvitz side note, I don’t think OpenBSD has POSIX sh. Quoting the man page
This version of sh is actually ksh in disguise. As such, it also supports the features described in ksh(1). This manual page describes only the parts relevant to a POSIX compliant sh.
Just saying as I got caught thinking my scripts were POSIX compliant on OpenBSD and failed when running them using FreeBSD sh
️ -
@Larvitz side note, I don’t think OpenBSD has POSIX sh. Quoting the man page
This version of sh is actually ksh in disguise. As such, it also supports the features described in ksh(1). This manual page describes only the parts relevant to a POSIX compliant sh.
Just saying as I got caught thinking my scripts were POSIX compliant on OpenBSD and failed when running them using FreeBSD sh
️@joel thanks for the hint. I actually wasn’t aware of that! Always thought it’s defaulting to a korn shell.
-
R relay@relay.mycrowd.ca shared this topic
-
New post: shell tricks that aren't exactly secret, but aren't always taught either.
Split into two sections: what works on any POSIX sh (FreeBSD, OpenBSD, Alpine...) and what's Bash/Zsh-specific. Because not everyone is on Linux with bash as their login shell.
Things like CTRL+W, $_, pushd/popd, fc, set -euo pipefail caveats, and more.
Shell Tricks That Actually Make Life Easier (And Save Your Sanity)
Watch someone backspace 40 characters instead of pressing CTRL+W, and you’ll understand why this list exists. A collection of shell tricks-grouped by what wo...
Larvitz Blog (blog.hofstede.it)
@Larvitz I wish I'd known about C-x C-e years ago, and also yesterday it would have been convenient. But now I know it for the future. Thank you!
-
New post: shell tricks that aren't exactly secret, but aren't always taught either.
Split into two sections: what works on any POSIX sh (FreeBSD, OpenBSD, Alpine...) and what's Bash/Zsh-specific. Because not everyone is on Linux with bash as their login shell.
Things like CTRL+W, $_, pushd/popd, fc, set -euo pipefail caveats, and more.
Shell Tricks That Actually Make Life Easier (And Save Your Sanity)
Watch someone backspace 40 characters instead of pressing CTRL+W, and you’ll understand why this list exists. A collection of shell tricks-grouped by what wo...
Larvitz Blog (blog.hofstede.it)
@Larvitz THANK YOU VERY MUCH!!!! A lot of things I did not know up to now. That helps a lot.
-
New post: shell tricks that aren't exactly secret, but aren't always taught either.
Split into two sections: what works on any POSIX sh (FreeBSD, OpenBSD, Alpine...) and what's Bash/Zsh-specific. Because not everyone is on Linux with bash as their login shell.
Things like CTRL+W, $_, pushd/popd, fc, set -euo pipefail caveats, and more.
Shell Tricks That Actually Make Life Easier (And Save Your Sanity)
Watch someone backspace 40 characters instead of pressing CTRL+W, and you’ll understand why this list exists. A collection of shell tricks-grouped by what wo...
Larvitz Blog (blog.hofstede.it)
Ah, you don’t really need that anymore these days 🫣 — Gemini CLI and Codex are faster anyway
