09-21-2005
How to check whether a string is number or not
Hi ,
I am facing a problem .. which looks simple... but took 2 days of mine.. even now it is not solved completely..
I have one variable..., want to know whether that variable contains number... canbe +ve or -ve ...
Values
+35 --- number
-43 --- number
45A -- non number
34+45 -- non number
please help me
Shihab
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am passing an argument to a file and i wanna check whether the argument is a number or string ?
how can i do this? (4 Replies)
Discussion started by: rolex.mp
4 Replies
2. Shell Programming and Scripting
Hello All,
Plz help me with:
I have a csv file with data separated by ',' and optionally enclosed by "". I want to check each of these values to see if they exceed the specified string length, and if they do I want to cut just that value to the max length allowed and keep the csv format as it... (9 Replies)
Discussion started by: ozzy80
9 Replies
3. Shell Programming and Scripting
Hi,
Can anyone help in the below problem.
file1 has the below contents
fileset 999 primary-ilist inode 37020 has invalid dotdot (426094) -> Not exist
fileset 999 primary-ilist inode 115016 dup block ->... (9 Replies)
Discussion started by: knshree
9 Replies
4. Shell Programming and Scripting
Hi,
Can anyone help me out to check whether the input argument is number?
Example:
REQUEST_ID="123456"
I need to check the REQUEST_ID value is number or string.
Thanks in Advance
Regards
BS (6 Replies)
Discussion started by: balajiora
6 Replies
5. Shell Programming and Scripting
Hi,
I have a file with data as given
$cat file1.txt
123
234
23e
234.456
234.876e
345.00
I am checking if the values are proper integers using the command.
nawk -F'|' 'int($1)!=$1 {printf "Error in field 1|"$0"\n"}' file1.txt
This is checking for only integers ( without... (10 Replies)
Discussion started by: ashwin3086
10 Replies
6. Shell Programming and Scripting
I have a txt file as database. when i run my program what it does is it ask me for 3 name and stored in the file as
name1:name2:name3:1
when u enter 3 name it add those in file as above format and add 1 at the end. I what i want is if i enter same names again it changes that 1 to 2 and so... (3 Replies)
Discussion started by: Learnerabc
3 Replies
7. Shell Programming and Scripting
Hey I'm new in linux,
I'm looking for a code to check whether the parameter is a number or a string.
I have already tried this code:
eerste=$(echo $1 | grep "^*$">aux)
if
But it doesn't work.:confused:
Thanks (2 Replies)
Discussion started by: Eclecticaa
2 Replies
8. Shell Programming and Scripting
I want to append file with a string but before doing that i want to check if this string already exist in that file.I tried with grep on Solaris 10 but unsuccessful.Man pages from grep seems to suggest if the string is found command status will be 0 and if not 1.But i am not finding it.May be i... (2 Replies)
Discussion started by: sahil_shine
2 Replies
9. UNIX for Beginners Questions & Answers
I have below code inside my awk script
if ( $0 ~ /SVC IN:/ )
{
svc_in=substr( $0,23 , 3);
if (msg_start == 1 && msg_end == 0)
{
msg_arr=$0;
}
}
else if ( $0 ~ /^SVC OUT:/ )
{
svc_out=substr( $0, 9, 3);
if (msg_start == 1 && msg_end == 0)
... (6 Replies)
Discussion started by: bhagya123
6 Replies
LEARN ABOUT XFREE86
glfrontface
GLFRONTFACE(3G) GLFRONTFACE(3G)
NAME
glFrontFace - define front- and back-facing polygons
C SPECIFICATION
void glFrontFace( GLenum mode )
PARAMETERS
mode Specifies the orientation of front-facing polygons. GL_CW and GL_CCW are accepted. The initial value is GL_CCW.
DESCRIPTION
In a scene composed entirely of opaque closed surfaces, back-facing polygons are never visible. Eliminating these invisible polygons has
the obvious benefit of speeding up the rendering of the image. To enable and disable elimination of back-facing polygons, call glEnable
and glDisable with argument GL_CULL_FACE.
The projection of a polygon to window coordinates is said to have clockwise winding if an imaginary object following the path from its
first vertex, its second vertex, and so on, to its last vertex, and finally back to its first vertex, moves in a clockwise direction about
the interior of the polygon. The polygon's winding is said to be counterclockwise if the imaginary object following the same path moves in
a counterclockwise direction about the interior of the polygon. glFrontFace specifies whether polygons with clockwise winding in window
coordinates, or counterclockwise winding in window coordinates, are taken to be front-facing. Passing GL_CCW to mode selects counterclock-
wise polygons as front-facing; GL_CW selects clockwise polygons as front-facing. By default, counterclockwise polygons are taken to be
front-facing.
ERRORS
GL_INVALID_ENUM is generated if mode is not an accepted value.
GL_INVALID_OPERATION is generated if glFrontFace is executed between the execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGet with argument GL_FRONT_FACE
SEE ALSO
glCullFace(3G), glLightModel(3G)
GLFRONTFACE(3G)