11-19-2009
unix compare two variable
how can i unix compare two variable??
var1 = 6499 7328 6351 7583 7573
var2 = 6499 7328 6351 7583 7573
i did:
diff $var1 $var2
and i got the output:
diff: extra operand `6351'
diff: Try `diff --help' for more information.
whats wrong??
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello all:
I'm new in Unix and here and I'am spanish so my english isn't so good to explain my doubt. Here it is.
Very urgent:
I need to compare the value of a variable with a string.
Example is this.
Imagine that the variable x1 contains the path and a file text and I need to compare... (2 Replies)
Discussion started by: robdai
2 Replies
2. Shell Programming and Scripting
is it possible? if so, how?
i want to check a variable whether is it a number or letter in an if-else statement (6 Replies)
Discussion started by: finalight
6 Replies
3. Shell Programming and Scripting
hi everyone -
i have a bash script that does, in broad terms, the following:
given a file containing a list of email accounts, for every account, do , then move on to the next account. pretty simple, and all that stuff works fine.
thing is, there's a very good change that any account... (2 Replies)
Discussion started by: fearboy
2 Replies
4. Shell Programming and Scripting
dear all
i had two variable in my script.
var1 and var2
var1= 10 ( it will part of date op ) Fri Aug 8 10:05:09 IST 2008
var2=9 ( it will op of ls -ltr and time part of it.)
now i want to compare of them and want to do some task if both are are not same.
kindly let me know possible... (0 Replies)
Discussion started by: jaydeep_sadaria
0 Replies
5. Shell Programming and Scripting
i have an array call ignore. it is set up
ignore=34th56
ignore=re45ty
ignore=rt45yu
.
.
ignore=rthg34
n is a variable. I have another variable that i read from a different file. It is $2 and it is working the way i expect. array ignore read and print correct values.
in the below if... (2 Replies)
Discussion started by: usustarr
2 Replies
6. Shell Programming and Scripting
Hello,
I am working with KSH on AIX and I have 2 files generated from different sources... as seen below:
FILE1 FILE2
AAA AAA@ABS0001C
BBB BBB@ABS0003D
CCC CCC@ABS0023A
DDD DDD@ABC0145D
EEE EEE@ABS0090A
FFF FFF@ABS0002A
GGG GGG@ABC0150D
HHH
FILE1 is main main data source,... (4 Replies)
Discussion started by: right_coaster
4 Replies
7. Red Hat
Hello All,
I am running the below code in my script. I want if jk is empty nothing should be appened to the file total_usage.
but apparently its not happening.Kindy let me know how to do it.
###################################
jk=`ps auxf |grep -w $inputline|tr -s " "|cut -d... (0 Replies)
Discussion started by: ajaincv
0 Replies
8. UNIX for Dummies Questions & Answers
Hi
Could anyone please help with Awk.
The below code prints the PID of the matching process with condition with $8 and $9
ps -ef |awk '($8~/proc/) && ($9~/rPROC2/) {print $2}'
Now i want to change the Constant PROC2 from Shell variable
PROC2 is already declared in shell variable SRVNAME... (9 Replies)
Discussion started by: rakeshkumar
9 Replies
9. Shell Programming and Scripting
Please help me with this:
I need to compare two values in if condition in shell script but its goes always to else condition:
TIME_CHECK=PM
TIME-CLOCK=PM
if ; then
echo "You have access!"
else
echo "ACCESS DENIED!"
fi (5 Replies)
Discussion started by: aroragaurav.84
5 Replies
10. Shell Programming and Scripting
How to check if pattern is matching in variable or not.
I want to check file name in variable with the pattern.
Eg: file_name="AB1000.csv"
Check for below patterns
pattern1 = AB???
pattern2 = abc??*
if file_name == <patten1>
then
...
elif file_name == <pattern2>
---... (4 Replies)
Discussion started by: vegasluxor
4 Replies
LEARN ABOUT OPENSOLARIS
bzdiff
BZDIFF(1) General Commands Manual BZDIFF(1)
NAME
bzcmp, bzdiff - compare bzip2 compressed files
SYNOPSIS
bzcmp [ cmp_options ] file1 [ file2 ]
bzdiff [ diff_options ] file1 [ file2 ]
DESCRIPTION
Bzcmp and bzdiff are used to invoke the cmp or the diff program on bzip2 compressed files. All options specified are passed directly to
cmp or diff. If only 1 file is specified, then the files compared are file1 and an uncompressed file1.bz2. If two files are specified,
then they are uncompressed if necessary and fed to cmp or diff. The exit status from cmp or diff is preserved.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWbzip |
+--------------------+-----------------+
|Interface Stability | Committed |
+--------------------+-----------------+
SEE ALSO
cmp(1), diff(1), bzmore(1), bzless(1), bzgrep(1), bzip2(1)
BUGS
Messages from the cmp or diff programs refer to temporary filenames instead of those specified.
BZDIFF(1)