横幅命令有什么关系? [英] What's the deal with the banner command?

查看:26
本文介绍了横幅命令有什么关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些版本的 UNIX 和 Linux 中,有一个横幅命令(通常是/usr/bin/banner)可以打印出如下所示的出色输出:

In some versions of UNIX and Linux there's a banner command (usually /usr/bin/banner) that prints great output like this:

 #####  #######    #     #####  #    #
#     #    #      # #   #     # #   #
#          #     #   #  #       #  #
 #####     #    #     # #       ###
      #    #    ####### #       #  #
#     #    #    #     # #     # #   #
 #####     #    #     #  #####  #    #

在其他版本中,横幅命令(通常是/usr/games/banner)会打印一个巨大的横幅,就像您在 1980 年使用 Printshop 制作的那样,适用于生日聚会和其他活动.

In other versions, the banner command (frequently /usr/games/banner) prints an ENORMOUS banner like you'd make in 1980 with Printshop that are suited for use at birthday parties and stuff.

我倾向于为我的脚本使用横幅,但由于这个问题,它本质上是不可移植的.横幅"是 UNIX 的一部分,为什么不是 POSIX 标准的一部分?这是 BSD 与 SysV 的一些差异,但为什么还没有解决?

I tend to love using banner for my scripts but it inherently non-portable because of this issue. Is "banner" part of UNIX and why isn't part of the POSIX standards? This is some BSD vs SysV difference but why hasn't it been resolved?

我知道有 figlet 可以复制我喜欢的横幅.但我对这个命令的问题是可移植性.横幅应该是 UNIX 的一部分,恕我直言,即使它们需要以不同名称包含两个版本(尽管理想情况下,该行为应该合并到一个命令中,并为所需的输出).

I know there's figlet which reproduces the banner that I like. But my issue with this command is portability. Banner should be part of UNIX, IMHO, even if they need to include both versions under different names (although ideally the behavior should be merged into one command with an option for the desired output).

如果我使用横幅,在脚本的可移植性方面是不是我的运气不好?

Am I just crap out of luck when it comes to portability in scripts if I use banner?

推荐答案

因为在 POSIX 标准化时存在两种不同的行为,早在 80 年代末,标准中就省略了 banner.这不是必需的,也没有普遍的标准来选择标准".

Because there were the two divergent behaviours when POSIX was standardized, back in the late 80s, banner was omitted from the standard. It was not essential and there wasn't a prevailing standard to select as 'the standard'.

是的,如果您在脚本中使用 banner,那您就不走运了;该行为跨平台不可靠.

And yes, you are out of luck if you use banner in your script; the behaviour is not reliable across platforms.

这篇关于横幅命令有什么关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆