我正试图创建一个名为$SPIM
的变量,该变量保存which spim
的结果,但它却运行spim
,这不是我的意图。
➜ 10 git:(main) ✗ echo "$(which spim)"
/usr/bin/spim
➜ 10 git:(main) ✗ $SPIM=$(echo "$(which spim)")
SPIM Version 8.0 of January 8, 2010
Copyright 1990-2010, James R. Larus.
All Rights Reserved.
See the file README for a full copyright notice.
Loaded: /usr/lib/spim/exceptions.s
(spim) exit
在这里使用bash
运行,没有问题(我没有安装spim
(。不再需要echo
。
$ SPIM=$(which ls)
$ echo $SPIM
/usr/bin/ls