![스크립트 내용을 표준 출력으로 덤프](https://linux55.com/image/11286/%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%20%EB%82%B4%EC%9A%A9%EC%9D%84%20%ED%91%9C%EC%A4%80%20%EC%B6%9C%EB%A0%A5%EC%9C%BC%EB%A1%9C%20%EB%8D%A4%ED%94%84.png)
bash 해시의 $PATH에 무언가가 있는 경우 해당 스크립트의 내용을 덤프할 수 있는 방법이 있습니까?
예를 들어, 이렇게 하면:
$ type ores_git_push
나는 얻다:
ores_git_push is hashed (/usr/local/bin/ores_git_push)
스크립트 내용을 얻을 수 있는 방법이 있나요?
만약 내가한다면:
$ type -a ores_git_push
나는 얻다:
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
그래서 최악의 시나리오에서는 결과를 분석해 볼 수 있다고 생각했습니다 type -a
.
답변1
cat "$(type -p ores_git_push)"
답변2
그 오래된 고양이 명령은 어때요?
cat /usr/local/bin/ores_git_push
답변3
해시가 왜 중요한지는 잘 모르겠지만 다음과 같이 할 수 있습니다.
cat $(which ores_git_push)