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)
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)
Hi ,
I have code like below in my ksh script, but getting an error as SP2-0253: data item 1 ("SAMPLE_ID") will not fit on line , pls help me. thanks.
if (( CHECKS == 0 )) || (( CHECKS == 1 ))
then
V_SAMPLE_ID=$( $ORACLE_HOME/bin/sqlplus -S / <<EOF
whenever sqlerror exit 1... (5 Replies)
i have created a script that will reverse any given ineter.
#!/bin/ksh
echo "Enter the number"
read n
if
then
a=`expr $n / 10`
b=`expr $n % 10`
c=`expr $b \* 10 + $a`
fi
echo $c
---------------------------------------------------------------------
the problem with this script... (4 Replies)
I have search the forum for an easier way to write this code. I have two separate 'if' to do this and it works but am wondering if someone knows a quick way to combine them. I want anything between 1 and 100 but not '01' or '005', '0010', etc.
if ) ]] ||
]; then
echo "Try... (3 Replies)
Hey I am trying to calculate a number but I found out the expr I knew works only with integers. Any help. I want to calculate (120/220) *100.
Thanks! (2 Replies)
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)
I am migrating some shell script from Unix to Linux and i am getting wrong value for integer variable.
In Unix:
integer X=007300
echo $X
7300
In Linux:
integer X=007300
echo $X
3776
Please help me why it is giving wrong output. (1 Reply)
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
LEARN ABOUT REDHAT
llrint
LRINT(3) Linux Programmer's Manual LRINT(3)NAME
lrint, lrintf, lrintl, llrint, llrintf, llrintl - round to nearest integer
SYNOPSIS
#include <math.h>
long int lrint(double x);
long int lrintf(float x);
long int lrintl(long double x);
long long int llrint(double x);
long long int llrintf(float x);
long long int llrintl(long double x);
DESCRIPTION
These functions round their argument to the nearest integer value, using the current rounding direction. If x is infinite or NaN, or if
the rounded value is outside the range of the return type, the numeric result is unspecified. A domain error may occur if the magnitude of
x is too large.
RETURN VALUE
The rounded integer value.
ERRORS
EDOM The magnitude of x is too large and (math_errhandling & MATH_ERRNO) is non-zero.
CONFORMING TO
C99.
SEE ALSO ceil(3), floor(3), lround(3), nearbyint(3), rint(3), round(3)
2001-05-31 LRINT(3)