You are not logged in.
When running a script containing
#!/usr/bin/env bash
which foo$ ./test.sh
./test.sh: line 2: which: command not foundThe same happens with various interpreter variations
#!/bin/bash
#!/usr/bin/bash
#!/bin/sh
# etc.However, 'zsh' does work, for what it's worth. Please let me know if I can provide any additional information.
Offline
which is a program and a package not a built-in. Is your PATH broken? Are you using lightdm? It recently had an adjustment of it's session handling when using different shells and that caused some issues. echo your $PATH in one of the failing scripts.
Offline
What makes you think that 'which' is a bash builtin?
bash$ type which
which is /usr/bin/whichIf your script doesn't set PATH, call the binary by it's absolute path.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Online