04-10-2008
9 More Discussions You Might Find Interesting
1. IP Networking
i am writing a client and server program
client program
main()
{
int sockfd,n;
char str;
struct sockaddr_in sock;
if ((sockfd=socket(AF_INET,SOCK_STREAM,0))<0)
{
perror("SOCKET ERROR");
}
bzero(&sock,sizeof(sock));
sock.sin_family=AF_INET; (1 Reply)
Discussion started by: ramneek
1 Replies
2. Shell Programming and Scripting
Hi,
I did a df|awk| command and it returns a percentage "94%",
how could I only get the integer part
"94" out of it, so I can compare it to another number,
I knwo that I have to pipe it to sth, but "grep " did not work, it still give me number WITH the percentage, does someone know what... (3 Replies)
Discussion started by: ericaworld
3 Replies
3. UNIX for Dummies Questions & Answers
Hi all,
is there an easy way to convert integer to string in bash?
I have numbers like 1, 2, ..., 112, ...
and I would like to get
001 002 003 004 ...
Thank you,
Sarah (4 Replies)
Discussion started by: f_o_555
4 Replies
4. Shell Programming and Scripting
Hi folks,
I have a value like A12,i could able to change this into integer using typeset as below
typeset -i A12
But, I need your advice to change the values like 1A2 or 12A into integer.
Thanks in advance.
Thanks,
Sathish (3 Replies)
Discussion started by: bsathishmca
3 Replies
5. Solaris
hello,
i am writing a script that takes the UID from the PASSWD and then i want
to increse the Number by one. for the Next user.
i cannot get this to work that a variable is as interger
example:
set i = 0
set $i = $+1
it's in tcsh if it's mather (10 Replies)
Discussion started by: shatztal
10 Replies
6. Shell Programming and Scripting
hi,
how to I do this?
i="4.000"
if ; then
echo "smaller"
fi
how do I convert the "4.000" to 4?
Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies
7. Shell Programming and Scripting
I am on HP-UX using ksh in the script.
MaxSal=`sqlplus -silent /nolog <<EOF
connect / as sysdba
whenever sqlerror exit sql.sqlcode
set pagesize 0 feedback off verify off heading off echo off
select max(sal) from emp1;
select max(sal) from emp2;
select max(sal) from emp3;
exit;
EOF`... (3 Replies)
Discussion started by: bang_dba
3 Replies
8. Solaris
Hi
Using the below logic to check whether the value is integer or not and converting the value to decimal if not.
int_chck = sprintf(substr($i, 1, 2))
o_cnt = 'if ; then echo $int_chck; else echo $((0x$int_chck)); fi'
Thanks,
Dines (4 Replies)
Discussion started by: dineshnak
4 Replies
9. Programming
Hello and Good day, I am currently studying C and I just finished learning about variables mainly those of integer type.
I am wondering if the list below are all there is to integer variables and there are still more that i have to learn.
Here are the list:
Char
Short
int
long
long long... (3 Replies)
Discussion started by: split_func0
3 Replies
LEARN ABOUT OPENSOLARIS
prof
prof(5) Standards, Environments, and Macros prof(5)
NAME
prof - profile within a function
SYNOPSIS
#define MARK
#include <prof.h>
void MARK(name);
DESCRIPTION
MARK introduces a mark called name that is treated the same as a function entry point. Execution of the mark adds to a counter for that
mark, and program-counter time spent is accounted to the immediately preceding mark or to the function if there are no preceding marks
within the active function.
name may be any combination of letters, numbers, or underscores. Each name in a single compilation must be unique, but may be the same as
any ordinary program symbol.
For marks to be effective, the symbol MARK must be defined before the header prof.h is included, either by a preprocessor directive as in
the synopsis, or by a command line argument:
cc -p -DMARK work.c
If MARK is not defined, the MARK(name) statements may be left in the source files containing them and are ignored. prof -g must be used
to get information on all labels.
EXAMPLES
In this example, marks can be used to determine how much time is spent in each loop. Unless this example is compiled with MARK defined on
the command line, the marks are ignored.
#include <prof.h>
work( )
{
int i, j;
. . .
MARK(loop1);
for (i = 0; i < 2000; i++) {
. . .
}
MARK(loop2);
for (j = 0; j < 2000; j++) {
. . .
}
}
SEE ALSO
profil(2), monitor(3C)
SunOS 5.11 3 Jul 1990 prof(5)