Search Results

Search: Posts Made By: 14341
10,046
Posted By 14341
Hi Guys, Thank you for your suggestions. ...
Hi Guys,

Thank you for your suggestions.

Corona688,

Yes the application is both multi-processed and multi-threaded one.

The application comprises of both C++ code, Java code and some...
10,046
Posted By 14341
Which process has created a file ?
Hi All,

We have a multi-threaded application.

During the course of action, each process creates some files. Is there any way to know which process has created a particular file ?


Ex:...
Forum: Programming 01-05-2012
2,230
Posted By 14341
Problem with timely execution of threads...
Hi Guys,

We are having one multi-threaded application.

The scenario is as follows:

--------------------------------- Client 1
...
Forum: Programming 06-13-2011
2,238
Posted By 14341
Ambiguity in operator []
Hi All,

When i try to compile the following code for 64-bit it works, whereas for 32-bit version, Compiler barfs:


#include <iostream>
#include <string>

class String {
public:
...
3,865
Posted By 14341
Thank you danmero...
Thank you danmero (https://www.unix.com/members/302032802.html) ,ahmad.diab (https://www.unix.com/members/302042235.html), thegeek (https://www.unix.com/members/302060163.html)[/URL] and...
3,865
Posted By 14341
could you explain the logic behind this so that i...
could you explain the logic behind this so that i can tweak this later?

$ awk 'NR>1 && $1!=x{print a ORS b}{a=b;b=$0;x=$1}' file
a 3
a 4
b 3
b 4


If you could tell the logic i will make...
6,355
Posted By 14341
comm is the ideal candidate for doing the job. It...
comm is the ideal candidate for doing the job. It is faster than awk.


$comm file_orig file_new
contents(only in file_orig) contents(only in file_new) contents (common)


ourput consists of...
3,865
Posted By 14341
I have just given a sample there. it is not...
I have just given a sample there.
it is not 3,4 always.

the contents could be anything.

Thanks for your try.

Regards,
14341
3,865
Posted By 14341
How to extract the required lines?
Hi Techies,

I got struck in middle of a problem. I have the following data whose format is:

a 1
a 2
a 3
a 4
b 1
b 2
b 3
b 4
c 1
c 2
c 3
c 4
I wanted the output from this to be:

a...
3,562
Posted By 14341
Try this buddy
i think a simple solution would be to sort both the files and then use the comm utility.

comm -12 <(sort diff.txt) <(sort abc.txt)
2,214
Posted By 14341
It worked for me
Try this one

cat input | awk 'BEGIN{FS="\n";lines=3}{for (i=1;i<=NF;i++) if (NR >= lines) {gsub(/F/,"T",$0); print} else {print $i}}'
26,346
Posted By 14341
Thank you for all the replies. Right now I...
Thank you for all the replies.

Right now I am using the following. (using count as index)


#!/bin/bash

declare -a num
declare -a words

num=(1 2 3 4 5 6 7)
words=(one two three four...
26,346
Posted By 14341
Consider the following snippets. for var in...
Consider the following snippets.

for var in ${num[@]}
do
#do what ever u want
#here var points to num[0],num[1],..num[END] as #loop progresses
#
#Note that you did't use any variable to...
26,346
Posted By 14341
FYI : I am not any college student. Just out...
FYI : I am not any college student.

Just out of curiousity i wanted to know if there is option available in shell (to be paticular BASH Shell) that can be used directly to do the above specified...
26,346
Posted By 14341
Thanks for the reply. But in the initial...
Thanks for the reply.

But in the initial post itself i pointed out that i don't want to use an external index.

Regards,
14341
26,346
Posted By 14341
Thanks for the quick reply. You are actually...
Thanks for the quick reply.

You are actually printng
:num[num[0]]: :word[num[0]]:
:num[num[1]]: :word[num[1]]:
...
:num[num[6]]: :word[num[6]]:

I have chosen
num=(1 2 3 4 5 6 7)
But if i...
26,346
Posted By 14341
How to access the elements of two arrays with a single loop using the inbuilt index.
Hi all,
I wanted to access two arrays (of same size) using one for loop.

Ex:

#!/bin/bash

declare -a num
declare -a words

num=(1 2 3 4 5 6 7)
words=(one two three four five six seven)
...
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 08:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy