Skip to content

Conversation

@markokocic
Copy link
Collaborator

@markokocic markokocic commented Jan 13, 2026

fix just samplejournals [#2528]

Fixes simonmichael#2528 by forcing bash for the above targets.
Looks like "((" is bash specific idiom that doesn't work everywhere.
@markokocic
Copy link
Collaborator Author

I use Debian stable on WSL.

I tried executing the bash command before running just and setting the SHELL variable to /usr/bin/bash, but for some reason just decides to run these snippets using sh, which fails.

I also tried to put a space between (, but I get the same error as before.

The only way to make it work is by forcing it to use bash by putting #!/usr/bin/env bash

sh version on my system is the default one that comes with Debian stable. It's a symlink to dash:

marko@host ~/s/c/hledger (just) [2]> ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Feb  4  2025 /bin/sh -> dash*
marko@host ~/s/c/hledger (just)> ls -l /usr/bin/sh
lrwxrwxrwx 1 root root 4 Feb  4  2025 /usr/bin/sh -> dash*
marko@host ~/s/c/hledger (just)> dash -version
dash: 0: Illegal option -r
marko@host ~/s/c/hledger (just) [2]> dpkg -l dash
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  dash           0.5.12-12    amd64        POSIX-compliant shell

@simonmichael
Copy link
Owner

I see; just isn't affected by the shell you run it from; it always uses sh as its default shell. And on your system that is dash, which doesn't like something about that recipe.

I think the best thing is to make it use bash as default shell (and require bash to be installed). I think we just need to add set shell := ["bash", "-uc"] at the top, could you confirm ?

simonmichael added a commit that referenced this pull request Jan 14, 2026
This ensures just scripts are using a known shell, rather than just
`sh` which varies by system.
@simonmichael
Copy link
Owner

I went ahead and did that. If issues remain, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants