Duncaen / OpenDoas

A portable fork of the OpenBSD `doas` command
Other
623 stars 35 forks source link

doas doesn't work with [[ in bash #121

Closed peterwu closed 1 year ago

peterwu commented 1 year ago
$ [ -e ~/testfile ]        # good
$ [[ -e ~/testfile ]]      # good
$ doas [ -e ~/testfile ]   # good
$ doas [[ -e ~/testfile ]] # error below
doas: [[: command not found
Duncaen commented 1 year ago

[[ is a bash builtin, [ also exists as binary, doas does not know or try to attempt to execute commands it can't find in PATH in a shell.

You'll have to explicitly run it in a bash shell if you want to do this: doas bash -c '[[ -e ~/testfile ]]'.