2

I see the following behavior:

$ foo
Could not find foo in PATH
$ which foo
/usr/local/corp/bin/foo
$ readlink -f `which foo`
/path/to/opt/foo/foo
$ /usr/local/corp/bin/foo
starting foo, output for foo, blah blah blah

this is a Centos 7 machine with Linux kernel 3.10.0-1160.53.1.el7.x86_64 . The shell is bash.

Notes:

  • Yes, /usr/local/corp/bin is in my $PATH.
  • /usr/local/corp/bin/foo is a symlink to /path/to/actual/binary/foo.
  • hash -r doesn't help.
8
  • 1
    Does hash -r help?
    – user10489
    Commented Jul 13, 2022 at 11:17
  • 1
    Is that directory actually in your PATH? Commented Jul 13, 2022 at 11:24
  • @NasirRiley: See edit.
    – einpoklum
    Commented Jul 13, 2022 at 12:34
  • @user10489: See edit.
    – einpoklum
    Commented Jul 13, 2022 at 12:34
  • 2
    @einpoklum just run echo "$PATH" | sed 's|/sensitive/path|/some/path|g'. We probably don't need to know the specific path names, just see what's there. We will need to see the output of type -a foo though. My first guess is that you've aliased it to something else. Does \foo work as expected?
    – terdon
    Commented Jul 13, 2022 at 16:36

0

You must log in to answer this question.

Browse other questions tagged .