fprintf


 
Thread Tools Search this Thread
Top Forums Programming fprintf
# 1  
Old 10-28-2008
fprintf

Could someone explain me the following fprintf format:

fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);

Why just not use:

fprintf(stderr, "ry `%s --help' for more information.\n", program_name)

I mean what is _() does?
# 2  
Old 10-28-2008
That's a shortcut for the "gettext()" call. This call is used in UNIX internationalization, to allow messages to be translated into another locale other than the one it was written in. Essentially, some ".po" files contain maps from the native-language string into another translation, such as German. Then, if a user has selected german as her locale, for instance, LANG=de-de, then gettext call returns the German version of the string.

GNU has a nice page about explaining it: http://www.gnu.org/software/gettext/
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Fprintf issue

i had to send a mail an attachment which i got from find command. But i did not get mail but could see the following line in the logs "aliased to fprintf.c". Can someone help me to understand what does it mean?..As this issue is not occuring now, i could not replicate the problem now.Thanks. (1 Reply)
Discussion started by: jesu
1 Replies

2. Programming

fprintf() gives segmentation fault

Hi, I am using fprintf to write few strings toa file which has been opened in write mode. The syntax is as follows: printf("Testing 7A.\n"); fprintf(out_screen,"%s|%s|%s|%s|%s|\n",var1,var2,var3,var4,var5); printf("Testing 8.\n"); When I execute the code It prints "Testing 7A." then... (2 Replies)
Discussion started by: siba.s.nayak
2 Replies

3. Shell Programming and Scripting

Detect sprintf and fprintf bad use

Hello again, I don't know about regexp so I throw this question here: How can I detect files where, for example: sprintf (var1, "hello %s %s", sub1); The problem here is that we have 2 %s and only a variable. Or... the inverse: sprintf (var1, "hello %s %s", sub1, sub2, sub3,...subn); ... (2 Replies)
Discussion started by: albertogarcia
2 Replies

4. UNIX for Dummies Questions & Answers

how to write to file using fprintf in find command...

:D I once again am looking through the man pages and am still working on the find command to fully comprehend all its attributes.. i am a little stuck on a problem with how many options to -print there are and the only two I know how to use are printf and -print.. i can not make heads or tails of... (2 Replies)
Discussion started by: moxxx68
2 Replies
Login or Register to Ask a Question