Sponsored Content
Full Discussion: Integer check (again)...
Top Forums UNIX for Dummies Questions & Answers Integer check (again)... Post 302293248 by giannicello on Monday 2nd of March 2009 05:46:38 PM
Old 03-02-2009
Thank you. These are simpler than what I have. Both solutions worked. The only caveat is that the first solution can case the program to terminate if a user input happens to include any non-numeric character. If you can control that then it's fine.

The second solution covers all basis as far as my testing went.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cannot store integer value

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)
Discussion started by: bennichan
5 Replies

2. UNIX for Dummies Questions & Answers

Rouding off an integer

HI I want to round off an integer to the next multiple of 10 in shell script. (i.e.,) 91 should be rounded off to 100 and 90 should be rounded off to 90 It would be very helpful, if you can help me in this. Thanks in advance (4 Replies)
Discussion started by: dayamatrix
4 Replies

3. UNIX for Dummies Questions & Answers

integer to string

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. UNIX for Dummies Questions & Answers

Check if input is an integer or a floating point?

Hiii I actually intent to check the integer or floating point number input by user i.e. 23, 100, 55.25, 12.50 ..etc. However, when someone input strings or alpha character, my program has to show invalid input.!! Is there any Unix shell script syntax can help me to check ? Thanking you (2 Replies)
Discussion started by: krishnampkkm
2 Replies

5. Shell Programming and Scripting

Regex for for integer from 0-7 except 2

Hi, I am trying to use a regular exp to match any number between 0 and 7 except 2...... I am using: echo $myvar | egrep "{1}{1}" Which isnt working.... Please can someone help? Thanks yonderboy (10 Replies)
Discussion started by: yonderboy
10 Replies

6. Shell Programming and Scripting

Alphanumeric to integer

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

7. Shell Programming and Scripting

Convert to Integer

Hi fellows!! i'm doing something which is not working out for me properly which i don't understand why nowdate=`date +%s` echo $nowdate now the problem how to convert a date which is stored in a variable mydate="22/Oct/2011" mydate=`date -d '$mydate' +%s` it gives error... (11 Replies)
Discussion started by: me_newbie
11 Replies

8. Shell Programming and Scripting

how to compare string integer with an integer?

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

9. Shell Programming and Scripting

While Loop to Check for Integer

Hello All, In ksh I am trying to ensure that user inputs are integers otherwise redisplay prompt with the following code; a=0 b=0 c=0 read b?"Please enter a number: " read c?"Please enter another number: " while ] && ]; do read b?"Not a number. Please enter a number: " read c?"Not... (4 Replies)
Discussion started by: techieg
4 Replies

10. Solaris

Integer Validation

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
WNINTRO(7)						  Miscellaneous WordNettm Topics						WNINTRO(7)

NAME
wnintro - introduction to miscellaneous WordNet information SYNOPSIS
morphy - discussion of WordNet's morphological processing uniqbeg - unique beginners for noun hierarchies wngloss - glossary of terms used in WordNet wngroups - discussion of WordNet search code to group similar senses wnlicens - text of WordNet license agreement wnpkgs - information about WordNet packages and distribution wnstats - database statistics DESCRIPTION
This section of the WordNet Reference Manual contains manual pages that describe various topics related to WordNet and the semantic concor- dances, and a glossary of terms. SEE ALSO
wnintro(1), wnintro(3), wnintro(5), morphy(7), uniqbeg(7), wngroups(7), wnlicens(7), wnpkgs(7), wnstats(7), wngloss(7). Fellbaum, C. (1998), ed. "WordNet: An Electronic Lexical Database". MIT Press, Cambridge, MA. WordNet 3.0 Dec 2006 WNINTRO(7)
All times are GMT -4. The time now is 06:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy