blob: 8fde81ffc89c71191a0e78cbfffed71e086ecd88 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
---
title: "Write Posix Shell"
categories:
- blog
abstract: A shell script may be just what you need
date: 2023-04-05T21:54:48+02:00
year: 2023
draft: false
tags:
- POSIX
- shell
- scripting
- bash
- luke-smith
- jes-olson
---
[Jes Olson](https://j3s.sh/thought/write-posix-shell.html):
> when the problem you're solving is small, well defined,
> and unlikely to change, consider shell.
>
> when the problem you're solving involves linux,
> text processing, or managing files, consider shell.
This is what [Luke Smith](https://odysee.com/@Luke:7) taught me: a shell script is often enough. Of course, you can use Ruby, Python - heck, even JavaScript. But often, you don't need it, as a simple shell is more than enough.
What FreeBSD experience added to that is portability. I try not to use bashisms anymore (thanks to [shellcheck](https://www.shellcheck.net)), as POSIX is good enough. If it's not, maybe shell is not the best approach for this problem. Portability and lack of dependencies will pay out eventually.
|