I saw this and my first though was 'Come on! The #Almquist shell has never been ported to #macOS before 2026⁈ It must have been there since the #NeXTStep days, surely. Someone has simply not known about it because xe never thought to look up the name Almquist.'

https://github.com/dotike/fsh

So I went looking.

Mad as it may seem, from what I've found so far, an Almquist shell on macOS does not turn up before 2025.

https://formulae.brew.sh/formula/dash-shell

Nary a mention of Almquist on Apple StackExchange.

It looks like macOS went straight from the C shell on NeXTStep to the Bourne Again shell.

But macOS has had a Korn shell for decades, right?

#UnixShells

GitHub - dotike/fsh: FreeBSD shell port for use on MacOS

FreeBSD shell port for use on MacOS. Contribute to dotike/fsh development by creating an account on GitHub.

GitHub

@cks

For what it's worth, the actual Bourne shell, in #Illumos, does not have an -l option.

https://illumos.org/man/1HAS/sh

#UnixShells

illumos: manual page: sh.1has

@cks

There is something general, but the Bourne Again is one of the #UnixShells exceptions that doesn't support it.

The Z, Watanabe, Almquist (Debian, FreeBSD, & NetBSD), Korn (various), & Bourne Again shells allow combining -l -and -c.

Of those, only the Bourne Again and Debian Almquist shells do not include l in the $- variable. Notably, the BSD Almquists do.

Of the same those, only the Z shell and the Almquists do not include c in $- .

The Watanabe and the Korns have l and c in $-.

@cks

Which shell is that?

#UnixShells

@rl_dane

The alternative is to make the shell handle the un-escaping:

echo hello,there |sed 's/,/'"\n"'/g'

It's undocumented in several ksh flavours, but nonetheless works. However, those flavours also (trying a quick few tests) support the better way, which is also undocumented though:

echo hello,there |sed $'s/,/\n/g'

#sed #UnixShells #KornShell #OpenBSD #ksh

@josevnz

Looks complex. (-:

C shell:

% printf '%s\n' $path

Z shell:

% printf '%q\n' "$path[@]"

#UnixShells #CShell #ZShell #zsh #csh

@ianthetechie

I was about to write the same thing.

And as @steeph pointed out, getopt in shell script does not allow one to do several things, including take advantage of the Z shell's ability to automatically construct command-line completions for anything that supports --help .

@rl_dane
#getopt #UnixShells #zsh

@bytebro

It's going to get less accurate as the months go by. It's a simple #arithmetic trick, and you can tell which year the image was faked for.

The number, in repetitions on the WWW, goes as low as 78, so you can tell what year this trick began doing the rounds, too.

Now for true mentalist tricks, look at how the GNU date command and a POSIX-conformant shell can magically, with just one line, work out the year that you were born:

date -r "-$(((2+1)*3*2*5*487*6*10*9<<4))" +'%Y'

#mentalism #UnixShells

I just read about MUSH (Microsoft User Shell) – which is the keyboard-based pre-pulldown menu system that existed in Multiplan, Word or XTree – and early drafts of Microsoft Interface Manager, an text UI precursor of Windows which resembled DOSShell from MS-DOS 4, on the website of @nina_kali_nina . I remembered there actually was a Visual Shell, vsh in Microsoft Xenix (their Unix OS). Sadly, browsing was not very intuitive … #softwarearcheology #unix #unixshells

@rqm

@rl_dane hit the nail on the head.

This isn't really specific to completion. It's just general overlong input line editing behaviour.

The PD #KornShell and its derivatives (e.g. the #MirBSD Korn Shell) only have line editing with a single line that sideways scrolls.

ksh93, however, has a
set -o multiline
option for switching to a multiple-line line editing mode. (The Z and Bourne Again shells have similar.)

You might like the Watanabe shell. It's in ports.

@magicant
#UnixShells