我有这个循环config.fish
:
set W_COLS (tput cols)
for x in (seq $W_COLS)
echo $x
end
这很好用,迭代了我终端的宽度。我得到并输出:
1
2
3
.
.
.
80
我想并排打印数字,不换行。
我试过这样做echo -n $x
,但这导致循环不再工作,我只是得到一个准系统外壳:
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
>
为什么循环失败?