我有以下脚本。
python3_path = $(which python3)
echo "Python 3 path: "
echo $python3_path
我收到以下错误:
./seed.sh: line 123: python3_path: command not found
Python 3 path:
我不确定为什么python3_path在这里是空的。
答案 0 :(得分:2)
=
周围放置空格。
请改为尝试:
python3_path=$(which python3)
echo "Python 3 path: "
echo $python3_path
或者您也可以这样做:
python3_path=$(which python3)
echo "Python 3 path: $python3_path"
或者这种方式更短:
echo "Python 3 path: $(which python3)"