@dmbaturin @jessebot
I once received a shell script to add to our stack from a third party developer for the purpose of an integration project. I pointed out a #bashism (we were running busybox sh with partial bash compatibility). I then received an updated patch that only changed the shebang from #!/bin/sh to #!/bin/bash . So I had to explain again.

@davetron5000 BTW, the code I posted before had errors. Here's a one-liner that actually works with #Docker and #AlpineLinux.

```bash
docker run --privileged -i --rm alpine:latest \
<<< 'apk update && apk add usbutils && lsusb -t && exit'
```

The redirection operator is a #bashism that won't work as-is in #Bourne or #FishShell. However, I validated that it works as intended under Bash, and thus probably under #Z-Shell. Hope it's useful to you, or to anyone running #TrueNAS Scale.

i feel silly i didnt know this #bashism already. take a ; delimited list and loop on it's values

DATA="this=that;is=isnt;a=b;list=ok"
D=""
for opt in ${DATA//;/ }; do
D="${D} -d ${opt}"
done
curl -x POST "$D" api/search

@nixCraft missing POSIX form
[ "${var%search*}" != "${var}" ]
No need for #bashism

#Unix #shell fun fact:

“source” is a #bashism. The actual #POSIX name of the command is “.”. That’s right, a single dot.

Many people expect . to be some kind of a shortcut for “source”, and yes, they’re equivalent in #bash, but “source” is not guaranteed to exist in other shells. dash doesn’t have it, for example.

So, if you want to write your shell scripts as compatible as possible, use “.”, not “source”.

#Linux #CLI

@konst Since you’re saying “etc.”, I feel compelled to mention that `<<<` works in bash, but is not in POSIX and will therefore for example not work in #!/bin/sh scripts in Debian. See https://mywiki.wooledge.org/Bashism

#bashism

Bashism - Greg's Wiki

@scy @w4v3 source ist #bashism
@T045T Was mir da noch einfällt: Das ist zwar #bashism und daher verwende ich es nicht, aber du kannst in bash scripts mit pushd und popd arbeiten und damit dir damit einen pfad historie aufbauen und wieder zurück gehen.