9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi,
i am new to shell programming, can u please tell me how to perform XOr operation of two strings.
i tried to do xor using ^symbol but this doesnt work.
help me with this
Thanks (12 Replies)
Discussion started by: anil_uvce
12 Replies
2. FAQ Submission Queue
The purpose of this article is revealing the unrevealed parts of the bitwise XOR.
As we aware, the truth table for the XOR operator is :
A B A^B
0 0 0
0 1 1
1 0 1
1 1 0
For example , 1^2 will be calculated as given below:
First the operands... (1 Reply)
Discussion started by: pandeesh
1 Replies
3. UNIX for Dummies Questions & Answers
I am aware of truth table for XOR between binary values .
Out of curious in would like to know how XOR works between 2 strings which contain alphabets .
For example A ^ B
How it works internally?
Please help me to understand this
Thanks (1 Reply)
Discussion started by: pandeesh
1 Replies
4. Programming
Hi,
In the below C code,
#include <stdio.h>
void print() {
printf("Hello\n");
}
int main() {
void (*f)() = (void (*)()) print;
f();
(*f)();
}
I wonder, how the syntaxes "f()" and "(*f)()" are treated as same without any error? Is this an improvement or ANSI/ISO... (1 Reply)
Discussion started by: royalibrahim
1 Replies
5. Shell Programming and Scripting
Hi,
In the following perl code:
#!/usr/bin/perl -w
if (open(FILE, "< in_file")) {
while (<FILE>) {
chomp($_);
if ($_ =~ /patt$/) {
my $f = (split(" ", $_));
print "$f\n";
}
}
close FILE;
}
Why changing the "FILE" as... (4 Replies)
Discussion started by: royalibrahim
4 Replies
6. Shell Programming and Scripting
Hi,
What is the difference in the following two awk one-liners?
awk -F, '{s++} END {if (s == 1 && $4 > "09:10:00") {print $2, $4}}' f1
awk -F, '{s++} s == 1 && $4 > "09:10:00" {print $2, $4}' f1
Even though, all the 2nd column values have duplicate records, the first code does not give any... (4 Replies)
Discussion started by: royalibrahim
4 Replies
7. Shell Programming and Scripting
i have to xor two variables in ksh. how to do that?
tia,
DN2 (5 Replies)
Discussion started by: DukeNuke2
5 Replies
8. Programming
Hi !
How to reset a variable to 0 after a reset value, say 10 using bitwise
XOR.
For example,
int cnt=0;
if(cnt<10)
cnt++;
else
cnt = 0;
How can we achieve this by using XOR only.
thanks, (1 Reply)
Discussion started by: mrgubbala
1 Replies
9. Shell Programming and Scripting
i posted a reply the other day and needed an answer to this question while i was clarifyiing a few matter.. "how to compare to date variable in string format without having to compare word for word"..
my reply was to try to use awk to compare the strings.. I wasn't quite sure if i remembered how... (2 Replies)
Discussion started by: moxxx68
2 Replies