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.
But, in this case there are two issues.
1) If the input contains numeric values the input value will be displayed which i don't want.
2) If special characters mentioned above are included, the script fails.
I've given up. I would really appreciate if anyone can help me out.
I am learning Shell scripting on own. I am trying to do an assignment to get details from the user like username their individual marks ,DOB and send a report in mail with the Details calculated like total and average.
validate_marks() {
local Value=$1
if &&
then
return 0
else... (1 Reply)
Hi All
I am trying to validate a value using if condition
requirement is need to check whether its a valid numeric value
the input contains ( space, #N/A and negative and positive decimal values and Zeros)
if it contains the space, I need to display the error message as space
... (15 Replies)
Hi
I need to put the validation in batch script when user will enter the build number it should be numeric.I can put the validation for numeric values but there is .(dot) in number so it would not take it as numeric.
Is it possible we can store it in variable and remove the .(dot) from the... (1 Reply)
Hi All,
I need to write a small piece of code to check the following.
name should contain (A-Z), spaces, hyphens & apostrophes
I need to generate regular expressions for the same.
Please help me out as i am not familiar with regular expressions. (1 Reply)
Hi,
I am new to Unix shell scripting and need help to add some validation to an existing script.
I've made a script that takes two argument (input) but I want the script to display an error message when nothing (null) is entered. So far I managed to validate the fist argument but fail to... (2 Replies)
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)
I am validating a form using php script and I want to "echo" the error message near to the text box itself & not below all the controls....Can I Position the display messages ?..Pls help me... (2 Replies)
I'm kinda new in shell scripting. How do i validate an input from a user to conform to requirement. For example,
echo "Enter First Name: "
read FName
echo "Enter Date of Employment (dd/mm/yyyy): "
read DoE
If the user enters data that is alphanumeric, it accepts it. I hope i've... (1 Reply)