03-10-2009
Yes, exactly. sprintf make scalar.
Thanks.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi i am using this command which would return to be the filename
ls -l $dir1 | awk '{print $9}'
however on perl when i use:
`ls -l $dir1 | awk '{print \$9}' > tmp`
it gives me a different result. Everything is the same however a directory does not contain the the forward slash so i... (2 Replies)
Discussion started by: nookie
2 Replies
2. Programming
Hi
My requirement is to convert the following to C++
char buffer;
sprintf(buffer,"%s %-50s %6s %-6d %s\n",a.substr(0,5),a.substr(10,20))
Since the buffer is of varying length, i cannot hardcode the value as 90.
i would like to convert the buffer to string object so that it can receive any... (1 Reply)
Discussion started by: dhanamurthy
1 Replies
3. Shell Programming and Scripting
Dear all,
I am new to perl script and would need some help for my 1st script. I wrote a script to search sprintf(buf,"%s", sourcestring) and replace with snprintf(buf, sizeof(buf),"%s", sourcestring). As snprintf() requires an extra argument, so it is not a simple search-and-replace. I need to... (1 Reply)
Discussion started by: ChaMeN
1 Replies
4. Shell Programming and Scripting
I would like to assign the output of printf to a variable in perl , it give me back a "1" instead of the time. How can I stuff the variable with what printf returns?
Here is my code:
#!/usr/bin/perl
$time = localtime(time);... (3 Replies)
Discussion started by: Dabheeruz
3 Replies
5. Shell Programming and Scripting
Hi,
I am a JAVA programmer and I have no idea about perl. I did use it a long time ago and I don't even remember the basics. So here is my problem:
In my work, I am supposed to build a simple program that opens a website (Gene Ontology)and passes my query and returns the result into a file. The... (1 Reply)
Discussion started by: chavanak
1 Replies
6. Shell Programming and Scripting
Hi,
How do i get result set in perl script using isql while connecting sybase server.
I have a perl script which connected to sybase and get the result set. but i wanted to get the result set. How do i get the result set in perl script not unix shell script..
$server ="ServerName";
open... (1 Reply)
Discussion started by: solo123
1 Replies
7. Programming
Hi,
I have the below sample code to hash the input number read from file. File will have 16 to 19 digit number and executable hash the number using some logic and returns the hashed value. Each digit in the 16 digit number is converted to a 4 byte value. That if the input is 16digit integer, the... (6 Replies)
Discussion started by: ramkrix
6 Replies
8. Shell Programming and Scripting
The required form of command is as
perl /product/editique/RFR/preproc/scripts/ExprEval.pl -P 'EGAL_CHAINE (" ","")' -K /varsoft/editique/RFR/preproc/logs/D.RFR.PR.PCAC9.PCPA.00.54.20110920.Evaluate_Expression.logWhat's wrong with this code (it is not quoting the function, I have checked... (1 Reply)
Discussion started by: ezee
1 Replies
9. Shell Programming and Scripting
for some reasons, i need to parse the XML result by using perl.
for instance, this is a sample XML result:
<Response>
<status>success</status>
<answer>AAA::AAA</answer>
<answer>BBB::BBB</answer>
</Response>
then i can use this way :
my @output = ();
foreach my $parts (@all) ##@all... (2 Replies)
Discussion started by: tiger2000
2 Replies
10. Shell Programming and Scripting
Hi all,
I am using the below code to ping a code and print whehter the connection is successful or not.
use Net::Ping;
$p = Net::Ping->new();
my $host = "x.x.x.x";
# print "$host is alive.\n" if $p->ping($host);
if ($p->ping($host,3))
{
print... (0 Replies)
Discussion started by: scriptscript
0 Replies
LEARN ABOUT DEBIAN
explain_sprintf_or_die
explain_sprintf_or_die(3) Library Functions Manual explain_sprintf_or_die(3)
NAME
explain_sprintf_or_die - formatted output conversion and report errors
SYNOPSIS
#include <libexplain/sprintf.h>
int explain_sprintf_or_die(char *data, const char *format, ...);
int explain_sprintf_on_error(char *data, const char *format, ...);
DESCRIPTION
The explain_sprintf_or_die function is used to call the sprintf(3) system call. On failure an explanation will be printed to stderr,
obtained from the explain_sprintf(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_sprintf_on_error function is used to call the sprintf(3) system call. On failure an explanation will be printed to stderr,
obtained from the explain_sprintf(3) function, but still returns to the caller.
data The data, exactly as to be passed to the sprintf(3) system call.
format The format, exactly as to be passed to the sprintf(3) system call.
RETURN VALUE
The explain_sprintf_or_die function only returns on success, see sprintf(3) for more information. On failure, prints an explanation and
exits, it does not return.
The explain_sprintf_on_error function always returns the value return by the wrapped sprintf(3) system call.
EXAMPLE
The explain_sprintf_or_die function is intended to be used in a fashion similar to the following example:
int result = explain_sprintf_or_die(data, format, ...);
SEE ALSO
sprintf(3)
formatted output conversion
explain_sprintf(3)
explain sprintf(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2010 Peter Miller
explain_sprintf_or_die(3)