我有一个.tmux.conf,我在安装了不同tmux版本的不同机器上使用.
我想根据tmux版本设置不同的鼠标选项.在一台机器上我有2.0另一个版本2.1.
我没有把他的意思弄清楚
if "[[(( $(tmux -V | cut -c 6-) < 2.1 ))]]" \
"set -g mode-mouse on;" \
"set -g mouse-resize-pane on;" \
"set -g select-pane on;" \
"set -g select-window on" "set -g mouse on"
Run Code Online (Sandbox Code Playgroud)
当我获取文件时
$ tmux source-file .tmux.conf
我收到这条消息
.tmux.conf:12: unknown command: set -g mouse-resize-pane on
我运行它的机器有版本2.1所以它不应该设置四个选项.
我想在运行tmux 2.0或更少时设置四个选项,或者在运行tmux 2.1时设置一个选项.
这个bash语句有效
$ tmux -V
tmux 2.1
$ if [[(( $(tmux -V | cut -c 6-) < 2.1 ))]];then echo …Run Code Online (Sandbox Code Playgroud) 我正在尝试执行简单的数学运算,检查变量是否大于或等于"1.5",但我得到了 [: 2.41: integer expression expected
码:
reSum=$(expr "scale=1;555/230" | bc)
if [ $reSum -ge "1.5" ]; then
...
fi
Run Code Online (Sandbox Code Playgroud)
如何在shell脚本中进行浮点比较?