04-27-2010
If you would have consulted our archives and searched for "test numbers" you might have found the following thread:
Check if the input is number or text?
You might also have searched for "check numbers" and you would have found this thread:
How to validate input parameters?
Which contains an in-depth discussion about exactly your problem in specific and input validation in general.
You could also search our archives for "input validation" and get 4 pages of hits in thread display - i haven't checked them all for relevancy, but i remember at least several of them as being related to your problem.
Google is your friend and the archive of this website is your ally. You generally get answers faster by searching the answers already given to others with similar (or even identical) problems as you then put the umpteenth thread dealing with a commonday problem here and expect people who have answered the same question already dozens of times to give you a genuine and elaborate answer.
I hope this helps.
bakunin
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
left value is 1.34 and i want it to compare against 4 right values 2.01, 3.01. 4.09 ,1.11 . This is not numerical comparion. I need for text. I get syntax errors ...
value =1.34 --> value will be passed dynamically..
if --> is this correct ?
{}
else
{}fi (2 Replies)
Discussion started by: PrasannaKS
2 Replies
2. Shell Programming and Scripting
Hi,
Now i work in a code that
1-get data stored in the database in the form of hash table with a key
field which is the " Name"
2-in the same time i open a txt file and loop through it word by word
3- which i have a problem in is that :
I need to loop word by word and check if it is a... (0 Replies)
Discussion started by: eng_shimaa
0 Replies
3. Programming
I wanna check if a file located in /home/user/.config/Home/unkilled.txt contains the word 'permitted'... I am a beginner in C++. This is my code:
1. #include <stdio.h>
2. #include <cerrno>
3. #include <sys/stat.h>
4. #include <fstream>
5. #include <sys/types.h>
6. #include... (1 Reply)
Discussion started by: hakermania
1 Replies
4. Shell Programming and Scripting
Im currently working on a Script using PICO editor, the scripts purpose is :
When you typed a certain "word" and press enter, All directories, Script, and any other files that contain that "word" will be displayed.. for example i typed "DOG".. all executable script, Directories, and any other... (3 Replies)
Discussion started by: jenimesh19
3 Replies
5. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Im currently doing a search command.. for example , when i typed a certain word , lets say "DOG".. all... (7 Replies)
Discussion started by: jenimesh19
7 Replies
6. UNIX for Dummies Questions & Answers
I am trying to see if a word exists within the file, then do command accordingly.
cmd=$(grep -ci "$word" $file)
if ; then
echo "Word exists"
else
echo "Word does not exist."
fiI try this code, but it keeps giving me syntax errors for the cmd line. Am I doing something... (3 Replies)
Discussion started by: itech4814
3 Replies
7. Shell Programming and Scripting
Input file:
ID_34 2E-69 2324
ID_1 0E0 3254
ID_1 0E0 5434
ID_5 0E0 436
ID_1 1E-14 2524
ID_1 5E-52 46437
ID_3 65E-20 45467
ID_1 0E0 6578
...
Desired output file:
ID_1 0E0 6578
ID_1 0E0 5434
ID_1 0E0 3254
ID_1 5E-52 46437
ID_1 1E-14 2524
ID_3 65E-20 45467 (5 Replies)
Discussion started by: cpp_beginner
5 Replies
8. Shell Programming and Scripting
Hi,
Need to extract only words not numbers
#cat test.txt
123456
oracle
web
56789
s21adm
Required output
#grep <options> test.txt
oracle
web
s21adm
Note, in between integer "s21adm" is required but not with full integer "123456" and "56789" (6 Replies)
Discussion started by: ksgnathan
6 Replies
9. Shell Programming and Scripting
Hi All,
I am looking for a perl/awk/sed command to auto-increment the numbers line in file, P1.tcl:
run_build_model sparc_ifu_dec
run_drc
set_faults -model path_delay -atpg_effectiveness -fault_coverage
add_delay_paths P1
set_atpg -abort_limit 1000
run_atpg -ndetects 1000
I would like... (6 Replies)
Discussion started by: jypark22
6 Replies
10. UNIX for Beginners Questions & Answers
I am trying to figure out to find word count of each word from my file
sample file
hi how are you
hi are you ok
sample out put
hi 1
how 1
are 1
you 1
hi 1
are 1
you 1
ok 1
wc -l filename is not helping , i think we will have to split the lines and count and then print and also... (4 Replies)
Discussion started by: mirwasim
4 Replies
LEARN ABOUT OSF1
randomword
randomword(3) Library Functions Manual randomword(3)
NAME
randomword, randomchars, randomletters - Generate random passwords (Enhanced Security)
LIBRARY
Security Library - libsecurity.so
SYNOPSIS
int randomchars( char *string, unsigned short int minlen, unsigned short int maxlen, boolean restrict, long seed);
int randomletters( char *string, unsigned short int minlen, unsigned short int maxlen, boolean restrict, long
seed);
int randomword( char *word, char *hyphenated_word, unsigned short int minlen, unsigned short int maxlen, boolean
restrict, long seed);
PARAMETERS
Points at a user-supplied space to contain a null-terminated password. Specifies the minimum length that a generated word can have. Spec-
ifies the maximum length that a generated word can have. Specifies whether restrictions are to be imposed on the generated word. This is
a boolean integer, where a non-zero integer indications restrictions and a 0 (zero) indicates no restrictions. Specifies an initial seed
for the random number generator. Points at a user-supplied space to contain a null-terminated random pronounceable password. Contains the
hyphenated version of the generated word.
DESCRIPTION
These functions generate random passwords for use in password selection. All of them are generated by the system, based on seeds and set
in the function. Such seeds can be created with the drand48(), rand(), or random() functions.
The randomchars() function places a null-terminated password composed of random printable ASCII characters into the string parameter and
returns the length of the generated string. The minlen parameter can equal maxlen, but cannot be greater than maxlen, and cannot be nega-
tive. The user space preallocated is at least maxlen for string. The smaller minlen and maxlen are, the smaller the selection space of
random words.
The restrict parameter is 0 (zero) when no restrictions are placed on the generated word. It is nonzero when the words generated pass the
tests of the acceptable_password() function.
The seed parameter is used by the function only on the first time it is called; the parameter is ignored on subsequent calls.
The randomletters() function places a null-terminated password composed of random lower-case letters into the string parameter and returns
the length of the generated word. The minlen, maxlen, restrict, and seed parameters are the same as for the randomchars() function.
The randomword() function places a null-terminated random pronounceable password into the word parameter and returns the length of the gen-
erated word. The minlen, maxlen, restrict, and seed parameters are the same as for the randomchars() and randomletters() functions. The
user space preallocated is at least 2*max - 1 for hyphenated_word.
NOTES
The password generator relies on a random number generator that produces uniformly distributed integers. Because the password generator
invokes the random number generator many times even for one word, the random number generator has to produce a uniform distribution. The
period (distinct numbers produced given a particular seed) and number space (range of possible numbers) must both be large. The drand48()
functions are used for this purpose.
Programs using these functions must be compiled with -lsecurity.
FILES
System password file. System group file.
RELATED INFORMATION
Functions: acceptable_password(3), drand48(3), rand(3), random(3).
Commands: login(1), passwd(1). delim off
randomword(3)