【发布时间】:2021-10-30 12:11:20
【问题描述】:
我有一个可执行文件command.sh
#/bin/bash
alias my_command='echo ok'
my_command
我的终端是 bash。
当我像./command.sh 一样运行它时,它运行良好。
当我像/bin/bash ./command.sh 一样运行它时,它找不到 my_command 可执行文件。
当我像/bin/sh ./command.sh 一样运行它时,它运行良好。
我在这里很困惑。问题出在哪里?
【问题讨论】:
-
"我的终端是 bash。"不,你的 shell 是 bash。