• 3
name Punditsdkoslkdosdkoskdo

What is #@(#) in Kornshell syntax

I'm looking at a script on an AIX box where several lines begin with #@(#)

What does that indicate? Clearly doing a Google search is totally fruitless for symbols.

Here are the lines from the script:

#@(#) 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.

The weird string "@(#)" is actually used by the ancient SCCS version control system. Specifically, the what command would look through a file (binary or text) and find ASCII-Nul-terminated strings that started with "@(#)", and print that string out. That allowed you to embed printable ASCII version numbers in ".o" files and ultimately executables, so you could tell what versions of which files ended up in the executable.

I think that the RCS ident command had a similar function.

The leading '#' does make the rest of the line into a ksh comment, so my guess is that some project wrote all their ksh scripts so that an SCCS what command would print out all the usage, etc for the scripts.

  • 8
Reply Report
    • @MaxVernon - you're welcome. I personally love this kind of question, as it exposes actual practices to a wider community, and it lets me mine my memory for whatever absurditites it has retained. If I might editorialize: "@(#)" saved me a few times in High Ritual production environments in the past. Why hasn't it survived? Knowing what versions got compiled together seems like valuable info.

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags