9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to read a text file and insert a string every n lines, but also have the line counter restart when I come across a header string.
Line repeating working every 3 lines using code:
sed '0~3 s/$/\nINSERT/g' < INPUT/PATH/FILE_NAME.txt > OUTPUT/PATH/FILE_NAME.txt
I cannot seem to find... (1 Reply)
Discussion started by: Skonectthedots
1 Replies
2. 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
3. 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
4. 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
5. Programming
Hi,
I am trying to reverse a string using the following program utilizing the Exclusive OR bit operation:
int main() {
char str = "Quraish";
char *p = str, temp;
char *q = str + strlen(str) - 1;
while ( p != q ) {
if (*p != *q) {
*p ^= *q; *q ^= *p; *p ^= *q;... (1 Reply)
Discussion started by: royalibrahim
1 Replies
6. Programming
Hi
Suppose we have these code lines:
#define _IN_USE 0x001 /* set when process slot is in use */
#define _EXITING 0x002 /* set when exit is expected */
#define _REFRESHING 0x004
...
1 main () {
2
3 unsigned r_flags =_REFRESHING;
4
5 if (r_flag &... (3 Replies)
Discussion started by: Puntino
3 Replies
7. Shell Programming and Scripting
I am taking an online course on Unix scripting. The topic is Unix arithmetic operators and the lesson is Logical and bitwise operations. It is not clear how much storage space Unix uses to represent integers that are typed. Bitwise negation caused me to question how many bits are used to... (3 Replies)
Discussion started by: dLloydm
3 Replies
8. 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
9. UNIX for Advanced & Expert Users
can anybody write a program to divide a number by another number using bitwise operators (9 Replies)
Discussion started by: areef4u
9 Replies