10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
data:
hello mr smith 400 you all ok?
hello mrs. smith 700 you all ok?
hello mr. everyone 150 you all ok?
hello mr. you all 199 im lad you are ok
using egrep, how can i grep out only lines that have a number greater than 250?
cat data | egrep .....
can't use awk here. i was... (7 Replies)
Discussion started by: SkySmart
7 Replies
2. Shell Programming and Scripting
I have a file with multiple fields, example below
File 1:
Field 1|Field 2|Field 3|Field 4|Field 5|Field 6|Field 7|100
Field 1|Field 2|Field 3|Field 4|Field 5|Field 6|Field 7|101
Field 1|Field 2|Field 3|Field 4|Field 5|Field 6|Field 7|102
Field 1|Field 2|Field 3|Field 4|Field 5|Field... (4 Replies)
Discussion started by: castrojc
4 Replies
3. Shell Programming and Scripting
I have an output from db which looks like :
row1 row2 row3
abc 21.1 13
efg 21.1 45
ghi 21.1 75
when I apply following command ( cat my_output.txt | awk {'print $ 4' }
I have following output :
row3
13
45
75
now I want to figure out if... (4 Replies)
Discussion started by: kvok
4 Replies
4. Shell Programming and Scripting
Hi
I want to find greater than and min value.
dategrep()
{
varlinenum=$1
varSESSTRANS_CL="$(egrep -n "<\/SESSTRANSFORMATIONINST>" tmpsess9580.txt | cut -d":" -f1)"
echo $varSESSTRANS_CL
}
dategrep 8
Output of the above command is:
I want to find out greater than 8 and... (9 Replies)
Discussion started by: tmalik79
9 Replies
5. Shell Programming and Scripting
BASH problem with IS GREATER THAN OR EQUAL TO.
I have tried a dozen variations for this IF statement to work with IS GREATER THAN OR EQUAL TO. My code below WORKS.
array=( $( /usr/bin/sar -q 1 30 |grep Average |awk '{print $2,$3}' ) )
nthreads="${array}"
avproc="${array}"
if && ; then ... (6 Replies)
Discussion started by: diex
6 Replies
6. Shell Programming and Scripting
I have some ASCII files containing numerous numbers. What I'd like to do is replace all numbers greater than 0 with 1.
Examples of the numbers include: - 000011 and 000042
Thanks (4 Replies)
Discussion started by: vrms
4 Replies
7. Shell Programming and Scripting
Sorry for such a basic question, but I have spent hours trying to work this out! I need an awk command (or similar) that will look at a text file and output to the screen if the 4th column of each line has a value greater than or equal to x.
data.txt
This is the 1 line
This is the 2 line
This... (6 Replies)
Discussion started by: dlam
6 Replies
8. Shell Programming and Scripting
Hi ,
I want to do the following:
i=6
case $i in
-lt 10)
echo Period=10
;;
-gt 10 && -lt 15)
echo Period-15
;;
>15 && <20)
echo Period=20
;;
>20 && <30)
... (2 Replies)
Discussion started by: sars
2 Replies
9. Shell Programming and Scripting
I need to grep out usernames with UID's greater than 200 out of the /etc/passwd file for a server migration. It is the third field however I am not sure to to accomplish this. I tried to search the forums but did not seem to find an answer (might have over looked it). Any help would be... (2 Replies)
Discussion started by: insania
2 Replies
10. Shell Programming and Scripting
Hello every one! I need a little help. I would like to know if there is someway I can use a "greater than" condition in a shell script.
#!/usr/bin/sh
_curTime=`date +%H%M`
if &&
then
echo "$_curTime"
fi
I know that "<" and ">" is to input and output to a file I just wanted... (2 Replies)
Discussion started by: Lem2003
2 Replies