10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
compare two variables and print the difference
i have two variables
X1=rac1,rac2
Y1=rac2,rac3
output=rac1,rac3
Use code tags to wrap code fragments or data samples. (1 Reply)
Discussion started by: jhonnyrip
1 Replies
2. UNIX for Beginners Questions & Answers
I have below code inside my awk script
if ( $0 ~ /SVC IN:/ )
{
svc_in=substr( $0,23 , 3);
if (msg_start == 1 && msg_end == 0)
{
msg_arr=$0;
}
}
else if ( $0 ~ /^SVC OUT:/ )
{
svc_out=substr( $0, 9, 3);
if (msg_start == 1 && msg_end == 0)
... (6 Replies)
Discussion started by: bhagya123
6 Replies
3. Shell Programming and Scripting
Hi
PRIM_SEQ=`some sql code`
and output of PRIM_SEQ is like below
120
130
STB_SEQ=`some sql code`
and output of STB_SEQ is like below
115
110
i need to compare this two variables output ( decimal numbers)
1) What I want to do is to compare every number in the PRIM_SEQ with... (8 Replies)
Discussion started by: amar1208
8 Replies
4. UNIX for Beginners Questions & Answers
I have two csv files of different sizes. The output file needs to have file1 contents on top of file2 contents where file2 col1 is >= to file1 col1, and file2 col1(same value) is < file1 col1 (next value). So basically, some file2 rows will be matched to the same file1 row because it is the closet... (7 Replies)
Discussion started by: aachave1
7 Replies
5. Shell Programming and Scripting
Hi, I have two variables with some values with 5 decimal digits and separated with space, the values of the variables are different, I want to make operations with this two variables.
The way was I find to do it itīs with files and
paste file1 file2 | awk '{print $1 - $2}'
I want to make it... (8 Replies)
Discussion started by: faka
8 Replies
6. Shell Programming and Scripting
Experts,
I have a bash shell script that generates 2 variables that have the current minute and a minute from a log file. Can someone please show me the best way to test if the minutes stray by 5. So basically if:
This is ok:
Last Fitting Min
=============
02
Current Minute
=============... (2 Replies)
Discussion started by: jaysunn
2 Replies
7. Shell Programming and Scripting
my files are as follows
fileA sepearated by tab /t
00 lieferungen
00 attractiop
01 done
02 forness
03 rasp
04 alwaysisng
04 funny
05 done1
fileB
funnymou120112
funnymou234470
mou3raspnhdhv
rddfgmoudone1438748
so all those record which are greater than 3 and which are not... (4 Replies)
Discussion started by: rajniman
4 Replies
8. Shell Programming and Scripting
ok this is probably going to turn out to be something really stupid but i've tried to use the following command in a script but the output is just a blank screen and i have to use Ctrl c to exit it.
awk 'BEGIN {printf "%.2f\n", '${bashArray}'>='$Variable' {print '${bashArray}'}}'
the command... (2 Replies)
Discussion started by: zagreus360
2 Replies
9. Shell Programming and Scripting
Hi guys, How do I compare two variables using diff?
The way I'm thinking:
#!/bin/sh
a=cat asdf.x | wc -l
b=cat asdf.y |cut -d',' -f5 |grep -v '^$' |wc -l
diff $a $b
How to rewrite the above sciprt using only one line in command prompt? (2 Replies)
Discussion started by: onthetopo
2 Replies
10. Shell Programming and Scripting
Searched all over can't figure out how to compare variables of alpha and numeric characters.
Example a script that ask user to enter a password and then ask to repeat the password. (6 Replies)
Discussion started by: monx
6 Replies