05-25-2007
Checking numeric value
Hi,
How can I check numeric value in shell?
I am passing one parameter (integer) and I want to restrict any other characters except 0-9.
./script xyz 10
Here 2nd parameter (10) should be integer only.
Can anyone help on this?
Malay
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
Is there any code in Perl which can differentiate between numeric and non-numeric input? (11 Replies)
Discussion started by: Raynon
11 Replies
2. Solaris
Hello,
We have a Solaris 9 machine and recently our client want to create username based on staff numbers (all numeric).
Is there any limitation in Solaris regarding creating username with numeric values (eg: 13598029)?
Thanks & Regards
Aryawarman Mahzar (5 Replies)
Discussion started by: aryamahzar
5 Replies
3. Shell Programming and Scripting
Hi,
How to check whether an input to a shell script contain only numeric values.
Is there any way to check against the following characters.
&
(
)
|
\
"
'
<
>
`
I've used the following way.
echo $1 | grep "\{2\}$"
if
then (12 Replies)
Discussion started by: sumesh.abraham
12 Replies
4. Shell Programming and Scripting
Is there a simple way of determining whether a command line arguement is numeric or not?? I tried a search and didn't find anything similar...
This is the 2nd time I've made this post.... It didn't appear that the first one showed up ??
Sorry if this is a duplicate... (1 Reply)
Discussion started by: harrisjl
1 Replies
5. Shell Programming and Scripting
Is there an easy way using a command or other routine for testing whether an argument on the command line is numeric? Just want to validate... I ran a search and didn't find a similar question....
Thx (3 Replies)
Discussion started by: harrisjl
3 Replies
6. UNIX for Dummies Questions & Answers
Hi everyone, I want my script to check if the first argument has only numbers or not. Im not sure what im doing wrong.
This is how it looks like:
if *") ]
then
echo 'The first arguement should only be in numeric' 1>&2
exit 1
else
exit 0
fi (7 Replies)
Discussion started by: darkhider
7 Replies
7. Shell Programming and Scripting
Hi, I'm trying to check to see that the arguments given to my script are both numeric and positive integers. I'm using tcsh. I figured out the positive part, but I am having trouble with the arguments being numeric and integers
I have no idea where to get started with the checking them actually... (1 Reply)
Discussion started by: mistykz
1 Replies
8. UNIX for Dummies Questions & Answers
Can someone tell me how to change the first column in a very large 17k line file from a random 10 digit numeric value to a non numeric value. The format of lines in the file is:
1702938475,SNU022,201004
the first 10 numbers always begin with 170 (6 Replies)
Discussion started by: Bahf1s
6 Replies
9. SCO
Hi, (i'm sorry for my english)
I'm a problem on boot sco unix 5.0.5 open server.
this stop at "Checking protected password and checking subsystem databases"
(See this image )
I'm try this:
1) http://www.digipedia.pl/usenet/thread/50/37093/#post37094
2) SCO: SCO Unix - Server hangs... (9 Replies)
Discussion started by: buji
9 Replies
10. Shell Programming and Scripting
Gurus, Please need your help.
I'm saving a filetimestamp into $filetimestamp and
say....echo $filetimestamp gives 2015021612
I'm saving a cutoff_time into $cutoff_time
say....echo $cutoff_time gives 2015021514
now my requirement is to check if $filetimestamp is greater than... (4 Replies)
Discussion started by: thummi9090
4 Replies
LEARN ABOUT DEBIAN
isympy
isympy(1) isympy(1)
NAME
isympy - interactive shell for SymPy
SYNOPSIS
isympy [-c | --console]
isympy [ {-h | --help} | {-v | --version} ]
DESCRIPTION
isympy is a Python shell for SymPy. It is just a normal python shell (ipython shell if you have the ipython package installed) that exe-
cutes the following commands so that you don't have to:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z = symbols("xyz")
>>> k, m, n = symbols("kmn", integer=True)
So starting isympy is equivalent to starting python (or ipython) and executing the above commands by hand. It is intended for easy and
quick experimentation with SymPy. For more complicated programs, it is recommended to write a script and import things explicitly (using
the "from sympy import sin, log, Symbol, ..." idiom).
OPTIONS
-c shell, --console=shell
Use the specified shell (python or ipython) as console backend instead of the default one (ipython if present or python otherwise).
Example: isympy -c python
FILES
${HOME}/.sympy-history
Saves the history of commands when using the python shell as backend.
BUGS
The upstreams BTS can be found at <http://code.google.com/p/sympy/issues/list> Please report all bugs that you find in there, this will
help improve the overall quality of SymPy.
SEE ALSO
ipython(1), python(1)
2007-10-8 isympy(1)