Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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:

#!/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.
share|improve this question

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer
    
thanks for this great answer. Appreciate you taking the time to dig up those reference links. –  Max Vernon Jul 29 at 17:49
1  
The proper way to thank somebody is to "accept" the answer. –  hymie Jul 29 at 18:10
    
Thanks @hymie - I am aware of that. I just wanted something a little more personal. And I will accept if no other answer comes close (which I doubt, but why not wait?). See my DBA.SE profile for my acceptance rate. I did upvote, BTW. –  Max Vernon Jul 29 at 19:05
1  
@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. –  Bruce Ediger Jul 29 at 19:31
    
It seems you're absolutely correct, the scripts use the what command to print usage to the console. –  Max Vernon Jul 29 at 20:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.