10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
We are getting a curios result in one of AIX script. Its executed using !/bin/ksh .
After following line we get result of 3 in in the variable instance_count.
instance_count=`ps -ef | grep "script_check_instances.sh" | grep -v "grep" | wc -l`
But once we do a "ps -aef | grep... (2 Replies)
Discussion started by: niba
2 Replies
2. Shell Programming and Scripting
I have 2 and three params, both I should make sure thay numbers at one single line insted of checking for each one .
Example I wroote the following way.. checking for 2 and three seperately but I shud be able to do it at on statement
echo $2 | egrep '^+$' >/dev/null 2>&1
if ; then
echo... (2 Replies)
Discussion started by: raopatwari
2 Replies
3. Shell Programming and Scripting
Hi guys, I am working on a server where there are many users. The user names end in a 1 or a 2. I want to write a bash script that will say which users are in which group and was wondering if I could get some help. The only part I am unsure of is how to check if it ends in the number.
Here's... (2 Replies)
Discussion started by: wua05
2 Replies
4. Shell Programming and Scripting
Hi,
I have a file with data as given
$cat file1.txt
123
234
23e
234.456
234.876e
345.00
I am checking if the values are proper integers using the command.
nawk -F'|' 'int($1)!=$1 {printf "Error in field 1|"$0"\n"}' file1.txt
This is checking for only integers ( without... (10 Replies)
Discussion started by: ashwin3086
10 Replies
5. Shell Programming and Scripting
Hi,
I have one file like 00123. And this file name is generated as a sequence.
So how can I confirm the generated file name is a number, not a special character or alphabets.
Can anybody help me out.
Thanks in advance. (3 Replies)
Discussion started by: Kattoor
3 Replies
6. Shell Programming and Scripting
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)
Discussion started by: glev2005
1 Replies
7. Shell Programming and Scripting
Hi,,
this is returning true in all cases..( other than 10 dig number also)
what could be wrong?? (2 Replies)
Discussion started by: shellwell
2 Replies
8. Shell Programming and Scripting
Hi ,
I am facing a problem .. which looks simple... but took 2 days of mine.. even now it is not solved completely..
I have one variable..., want to know whether that variable contains number... canbe +ve or -ve ...
Values
+35 --- number
-43 --- number
45A -- non number... (12 Replies)
Discussion started by: shihabvk
12 Replies
9. Shell Programming and Scripting
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)
Discussion started by: garric
3 Replies
10. UNIX for Dummies Questions & Answers
I am passing an argument to a file and i wanna check whether the argument is a number or string ?
how can i do this? (4 Replies)
Discussion started by: rolex.mp
4 Replies