what is #ident


 
Thread Tools Search this Thread
Top Forums Programming what is #ident
# 1  
Old 03-20-2006
what is #ident

what is the usage of #ident

I found the following statemant in begining of the shell scirpt ...

#ident "@(#) get.sh 6.12.1 09/30/97"

and I found the following statement in C file

#ident "@(#) getinp.h 5.1.2.1 07/11/97"

Thanks

Sarwan
# 2  
Old 03-20-2006
There is a program called "what" that will look inside executables and look for strings that have @(#) in them and display these strings. So originally you would do stuff like:
char ident[] = "@(#) something goes here";
to leave data for "what" to find. This means that string is part of your program and consumes space. When the new format for object files called elf came out, it had support for this stuff in the format. It's a special segment that exists in the file but is not loaded when the program runs. Compilers written by people who think standards are a good thing have a pragma to access this:
#pragma ident "@(#) something goes here"
From what you say, I guess that there is a compiler with a non-standard preprocessing directive.

In a shell script, it would just be a comment. With the @(#), "what" will still find it.

These "what strings" are often generated automatically by SCCS or RCS or CVS or similiar packages.
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sendmail auth/ident checking issue

Hi All, I have a problem sending mail to a host which seems to have sendmail configured to use Ident port (113) to check back on the mail sender. My problem is that this port is not enabled on the firewalls between sender and receiver so the ident checking and hence the mail is failing and... (0 Replies)
Discussion started by: Jublio
0 Replies

2. UNIX and Linux Applications

How to change ident in ircII

In ircII, how do I change the username and real name that shows up in the /whois ? (1 Reply)
Discussion started by: guitarscn
1 Replies

3. AIX

problem with #ident

I have an application which was originally compiled for AIX 4.3.3 which I am trying to compile with xlc 8 on aix 5.2. This app defines a macro called IDENT. Unfortunately, /usr/include/curses.h checks if IDENT is defined and if so, then defines #ident. Since #ident is apparently not supported by... (2 Replies)
Discussion started by: erick00
2 Replies

4. Programming

Regarding #ident macro

Hi, In my application I have some number c files. In each of the file the following line will be the first statement. #ident "@(#) set.c 14.1.2.2 05/15/01 17:06:32" I would like to know what is the use of the above statement. Thanks Sarwan (1 Reply)
Discussion started by: sarwan
1 Replies
Login or Register to Ask a Question