Dear friends
say i have a file like
1
2
3
5
8
9
16
17
35
36
.
.
..
till 50
now I ask user to give a input between 1 to 50.
now there are two condition
First: if the number is found in file then script should display the number --------------- no problem grep woks it for me
Second: but problem is this if the number given by user; does not found in the file then script should display the very next no to the screen. like say
echo " give a number between 1 to 50 " # user gives 5 !!! then script should display $read1
# if user gives 10 then script should display the very next no to 10 is 16.............
please help me ........
thanks to you all
say i have a file like
1
2
3
5
8
9
16
17
35
36
.
.
..
till 50
now I ask user to give a input between 1 to 50.
now there are two condition
First: if the number is found in file then script should display the number --------------- no problem grep woks it for me
Second: but problem is this if the number given by user; does not found in the file then script should display the very next no to the screen. like say
echo " give a number between 1 to 50 " # user gives 5 !!! then script should display $read1
# if user gives 10 then script should display the very next no to 10 is 16.............
please help me ........
thanks to you all
Comment