我在 BASH 脚本中显示了一些状态文本,例如:
Removed file "sandwich.txt". (1/2)
Removed file "fish.txt". (2/2)
我想让进度文本(1/2)
完全显示在右侧,与终端窗口的边缘对齐,例如:
Removed file "sandwich.txt". (1/2)
Removed file "fish.txt". (2/2)
我已经在 bash和右文本 align - bash中尝试了右对齐/填充数字的解决方案,但是,这些解决方案似乎不起作用,它们只是产生了一个很大的空白,例如:
Removed file "sandwich.txt". (1/2)
Removed file "fish.txt". (2/2)
我怎样才能让一些文本左对齐而一些文本右对齐?