I am writing a script that needs to accept numbers into a variable by prompting and using the code
read num
case $num in
000)
break
;;
*)
I am fairly new to unix and am loving the versatility of the language but need a little shove in the right... (1 Reply)
How do one evaulate a variable's value if it is number or not. say
var1=1234;
....
I want to check if $var1 contains a number or not. Is there any built-in command or combination of commands available?
Thanks,
Suman (1 Reply)
Hi Guys,
I am using the korn shell. I have an environments files where I have defined a variable
export START_TIME=060000
export END_TIME=220000
I source this environments file into one of my scripts.
The problem is that when I try to use this variable, I cannot get to use this variable as a... (2 Replies)
In a particular path of a server I have number of files.The files are generated every date with a date_mth stap on this.There are different files for different clients.
For example in /data1 path i have
X_0416_Score
Y_0416_Score
Z_0417_Score
X_0417_Score
A_0417_Score
If i will run the... (1 Reply)
Hi,
I'm new to unix and have a problem? I'm writing a basic script in ksh and it is a basic quiz with 5 questions. I need to be able to accumulate the correct answers at the end and echo out the total correct answers, I cannot work it out? Please see script so far. If anyone can help that will... (2 Replies)
Logic of code
if ( $var is a number ) {
Do something
}
else {
Do something else
}
My question is: How do I check if a variable is a number. All the reg ex that I came up with to match this is failing. Please help. (3 Replies)
Hi all,
I'm an extremely newbie with unix/perl. I have a perl script that I need to run on a variable number of input files (i.e., I have to run the perl script on each file, but from run to run, I have a different list of files that need to be put through this script).
I think this can... (2 Replies)
I have a file with a list of config files numbered on the lefthand side 1-300. I need to have bash read each lines number and assign it to a variable so it can be chosen by the user called by the script later.
Ex. 1 some data
2 something else
3 more stuff
which number do you... (1 Reply)
hi All,
My requirement is to replace variable number of in between character with X
The first 6 and last 4 characters will remain same and rest characters will be masked with X
Example - input String 12345678912345 output 123456XXXX2345
input string 123456 ... (1 Reply)