0

If I have something in the bash hash, on the $PATH, is there a way to dump the contents of that script?

e.g. if I do:

$ type ores_git_push

I get:

ores_git_push is hashed (/usr/local/bin/ores_git_push)

is there a way to get the contents of the script?

if I do:

$ type -a ores_git_push

I get:

ores_git_push is /Users/oleg/.nvm/versions/node/v10.10.0/bin/ores_git_push
ores_git_push is /usr/local/bin/ores_git_push

so worse case scenario I guess I could try to parse the results from type -a.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255

3 Answers3

2
cat "$(type -p ores_git_push)"
Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
1

What about the good old cat command?

cat /usr/local/bin/ores_git_push
Ipor Sircer
  • 14,546
  • 1
  • 27
  • 39
1

I'm not sure why the hash would matter, but you could do:

cat $(which ores_git_push)