0

e.g., /usr/bin/env bash -- what is the path to the bash that it executes?

I tried env -vvvvvvv bash but it doesn't show me:

$ env -vvvvvv bash
#env verbosity now at 2
#env verbosity now at 3
#env verbosity now at 4
#env verbosity now at 5
#env verbosity now at 6
#env verbosity now at 7
#env verbosity now at 8
#env executing: bash
#env    arg[0]= 'bash'
Rob Bednark
  • 25,981
  • 23
  • 80
  • 125
  • 3
    It's doing a $PATH search for bash, so I assume it would be the same as `which bash`. – Nick ODell Jul 02 '23 at 00:17
  • BTW, this isn't a bash question; `env` behaves the same way no matter which executable you tell it to invoke; there's no special-case behavior for bash. – Charles Duffy Jul 02 '23 at 00:37
  • 1
    BTW, the POSIX-standardized alternative to `which bash` is `command -v bash`. – Charles Duffy Jul 02 '23 at 00:38
  • 1
    (also, if you want to see what's actually being called definitively, `strace` will do that for you). – Charles Duffy Jul 02 '23 at 00:39
  • > BTW, this isn't a bash question; env behaves the same way no matter which executable you tell it to invoke; there's no special-case behavior for bash. – Yes, I struggled to find an appropriate tag. – Rob Bednark Jul 02 '23 at 00:43
  • > (also, if you want to see what's actually being called definitively, strace will do that for you). Unfortunately I'm running on MacOS, so "strace" isn't available. :-( – Rob Bednark Jul 02 '23 at 00:47
  • 1
    For future note, I'd use the [tag:unix] tag for questions about behavior of POSIX-standardized tools. (And as an aside re: strace alternatives, MacOS has `truss` in old versions and `dtruss` in new versions, but it's harder to use in recent years than it used to be on account of locked-down security) – Charles Duffy Jul 02 '23 at 20:41

0 Answers0