Kornshell 语法中的#@(#) 是什么

Han*_*non 6 ksh aix

我正在查看 AIX 框上的脚本,其中几行以 #@(#)

这说明什么?显然,对于符号进行 Google 搜索是完全徒劳的。

以下是脚本中的几行:

#!/usr/bin/ksh
#
#@(#)
#@(#) USAGE: dump_master_db [opts] SERVER [AREA]
#@(#)  opts: -p PAGENAME : send Pages to PAGENAME rather than the default (usually database)
#@(#)        -nodbcc     : will not do the DBCCs before the dump
#@(#)                     -c COMPRESSION_LEVEL : dump the database at the stated compression level.
#@(#)
#@(#) This script will do some DBCCs, truncates the log and then dumps the master database on any SERVER
#@(#) The SERVER parm is used to build the logical device name as follows:
#@(#)     SERVER_master_dump
#@(#) NOTE: There is no AREA and no stripes for this dump device.
#@(#)       COMPRESSION: VALUES 1 (least) to 9 (most compressed).
#@(#)       Currently, we only use values of none  to 1.
Run Code Online (Sandbox Code Playgroud)

Bru*_*ger 8

古老的 SCCS 版本控制系统实际上使用了奇怪的字符串“@(#)” 。具体来说,该what命令将查看文件(二进制或文本)并查找以“@(#)”开头的以 ASCII-Nul 结尾的字符串,并打印出该字符串。这允许您在“.o”文件和最终的可执行文件中嵌入可打印的 ASCII 版本号,这样您就可以知道哪些文件的哪个版本最终出现在可执行文件中。

我认为RCSident命令具有类似的功能。

领先的“#”确实将行的其余部分变成了ksh注释,所以我的猜测是某个项目编写了所有ksh脚本,以便 SCCSwhat命令打印出脚本的所有用法等。