Bash中的空白连接

问题很简单.
for i in `seq $begin $progress_length` ; do
  progress_bar=$progress_bar'#'
done

for i in `seq $middle $end` ; do
  empty_space=$empty_space' '
done

我需要empty_space来在进度条之后定位内容.我预计它将是x空格的字符串.但最后字符串是空的.我怎样才能创建x空格字符串?

问题可能是因为$empty_space只有空格.然后,要输出它们,你必须用双引号括起来:
echo "${empty_space}some_other_thing"

例如,您可以使用printf尝试更有趣的输出以获得多个空格.例如,要写20个空格:

v=`printf '%20s' ' '`

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...