Red Hat / Fedora :: Searching And Comparing The String

May 18, 2010

I have a file which provide the output of all the applications which started and running successfully. But it doesn't give the Error message of the applications which are failed. For example there are 5 applications (ABC,DEF,NMO,STO,XYZ) and application STO failed so I will get the following output (out.txt). content of out.txt file

Application ABC is Running
Application DEF is Running
Application NMO is Running
Application XYZ is Running

I want to generate the text message based on the information on out.txt that STO application is Failed.

View 2 Replies


ADVERTISEMENT

Programming :: Comparing String With Integer?

Sep 19, 2010

If I have a variable, say xvar, which can take both string and integer value and I want to perform an operation in following 2 conditions:1. Either xvar is null2. xvar equals 2[ -z "$xvar" ] || [ $xvar -eq 2 ] && <some-code>Doesn't seem to work if xvar takes string valuesI know that since I have no restriction on xvar, I can get away with string comparison in second test too, ie[ -z "$xvar" ] || [ "$xvar" = "2" ] && <some-code>
But, 'Sams teach yourself shell script in 24 hrs' says that [ expr1 -eq expr2 ], if either is string, it assumes 0 valueIs it true

View 5 Replies View Related

General :: Searching For Text String In All Files?

Mar 3, 2011

Is it possible to search ALL files on a system for a specific text string? I've been messing around with grep without any luck.

View 2 Replies View Related

General :: Searching A Particular String In All Files Of A Single Folder?

Jun 27, 2011

I just want to know if we can search for a particular string in all files of a particular folder in linux. if a folder has 100files only that hundred files needs to be checked for a particular string.

View 5 Replies View Related

Ubuntu Servers :: Terminal Command - Searching Given SH File For String

Mar 10, 2010

I need a hand with a line of terminal commands. I need to be able to search a given .sh file in a given location for a string, and when found, add a "#" to the start of that string and save the file back to it's original location.

View 1 Replies View Related

General :: Getting Segmention Fault Error While Searching String In Csv File?

Jan 18, 2011

I am using grep command to search in a particular file whose size is 11 GB and i am getting Segmentation fault error as an output. My command and output is as follows:

Code:

[sdpuser@gnnsdp40 test]$ cat new* | grep 8858406465
Segmentation fault

My linux version is as follows:

Code:

[sdpuser@gnnsdp40 test]$ uname -a Linux gnnsdp40 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

how i can parse the complete file for searching string. I have also used split command of linux which splits the file of 11 GB to 11 files of 1 GB each respectively. But still getting the same "Segmentation fault" error while using grep.

View 9 Replies View Related

General :: Searching A Specific Directory For Files Containing A Text String?

Nov 20, 2010

I am a member of a group which has written a program whose source code is being held in a specific directory (~cs252/Assignments/basicAsst/project) and we want to go through and change the parameters for the function "sequentialInsert." My job is to find all occurances of the function call to "sequentialInsert" and to also list the files from where the code came from. Also, I have to be in the commandsAsst directory when I do this. I have tried grep and find combined together, and I am at a lost.

View 1 Replies View Related

Ubuntu :: Sed - Searching Single And Double Quote Chars In Text String

Oct 27, 2010

I need sed to be able to search a string that includes both single quotes (') and double quotes ("). can anyone help me out, there has to be a way to do this.

So far I have tried:

But none of these work and I cannot think of how else to escape the sed quote inside of brackets.

View 3 Replies View Related

Fedora :: Replace A String By A String In Text File?

Apr 26, 2011

If I have a word in a text file and I need to replace it by another word (for example, i need to replace abc by fff) so what is the command I can type it?

I am using vi editor.

View 3 Replies View Related

Programming :: Copy String A To String B And Change String B With Toupper() And Count The Chars?

Oct 22, 2010

copy string a to string b and change string b with toupper() and count the chars

View 3 Replies View Related

Fedora :: Setting Shortkey Like Win 7 (Comparing Two Documents)

Jun 6, 2011

I want to set the shortkey like win7,WIN+ --> is mean half the window in the right side and WIN+<- is mean half the window in the left side. It is helpful for comparing two documents.

View 9 Replies View Related

Fedora :: Searching Error In Yum Gui

Mar 25, 2010

I was just trying to search for something in the yum gui and got the following error...Anyone else getting this?

Code:
Traceback (most recent call last):
File "/usr/share/PackageKit/helpers/yum/yumBackend.py", line 391, in _do_search
for (pkg, inst) in res:
ValueError: too many values to unpack

View 3 Replies View Related

Fedora :: Searching For Days Now For A Crossword App?

May 18, 2011

been searching for days now for a crossword app for Fedora... Im finding it extremely hard to believe that such app doesnt exist? Yet, my searching hasnt yielded anything so far. Is there nothing in the repo?

View 9 Replies View Related

Fedora :: Cannot Do Yum Update - Searching For Mirrors Forever

Feb 24, 2011

I'm on the Fedora 14. I'm getting troubles. I can't do YUM UPDATE! See the attached image. It's trying to search for mirrors forever. Impossible how awful the performance. What shall I do? My project development has been paused for a moment.

View 9 Replies View Related

Red Hat / Fedora :: Searching Path Of Some Basic HW Values

Apr 22, 2010

I would like know in which file is the machine name, os type and processor architecture stored in? I would like to know the path to those files where the value for os is i386 and machine i686 is something like this, in which file the systemuser and the number of users of that system is stored

/usr/src/redhat/RPMS/ ...

In these files i686 and I 386 is stored as directories and not as values but I want them as values in the file.

View 4 Replies View Related

Programming :: Pthread - Take String From The Command Line And Creates A Thread To Print The String

May 3, 2011

I've been trying to understand pthread in C a little better. So I made a simple program that takes in a string from the command line and creates a thread to print the string. I've looked online and copied the basic concepts but there are something things I'm confused about. The programs works just fine, but I have questions. Here's what I have so far.

[Code]....

One thing I'd like to know is why the 3rd argument in the pthread_create function which is my SendMessage function needs to be typecasted to a void pointer and then send the address of the function. Also as for the 4th argument, I would see typecasting to void pointer in some of the pthread examples I saw online, but in my case I'm passing a char pointer, would this be correct? In which case would I ever want to pass a void pointer?

Do I need a pthread_exit(NULL) in my main and in the SendMessage function? If so, why? I added the sleep() function so that I could let the pthread_exit function in my SendMessage function execute first. I simply saw that the online examples on pthread had pthread_exit() in both locations.

View 6 Replies View Related

Hardware :: Fedora 14 - Searching For Sound Card But Failed To Find

Jan 30, 2011

I recently installed Fodora 14 on a PC with Asus mainboard.
CPU is AMD LE-1100.
The sound card is Realtek ALC662-GR Azalia High Definition Audio
Unfortunately after installation, there is no sound.
In fedora, System->Preferences->Sound window, Hardware tab is empty.

I tried to install two versions of sound card driver.
One came from the CD of the mainboard called realtek-linux-audiopack-4.06x
First I tried to run the "install", it went through to the final GUI stage searching for the sound card but failed to find.
Then I tried to do a manual install following the readme file.
Basically, unpack->configure->make
but make failed with the following error message

make[1]: Entering directory '/home/user/00Sound/realtek-linux-audiopack-4.06x/alsa-driver-1.0.14rc3-4.06x/acore' .....
/lib/modules/2.6.35.6-45.fc14.i686/build/include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
make[1]: *** [memalloc.o] Error 1
make[1]: Leaving directory '/home/user/00Sound/realtek-linux-audiopack-4.06x/alsa-driver-1.0.14rc3-4.06x/acore'
make: *** [compile] Error 1

Later I tried to download another version of the driver from Realtek website
realtek-linux-audiopack-5.15
make also failed but with a different error:
make -C /lib/modules/2.6.35.6-45.fc14.i686/source SUBDIRS=/home/user/00Sound/realtek-linux-audiopack-5.15/alsa-driver-1.0.23 CPP="gcc -E" CC="gcc" modules .....
make: *** [compile] Error 2

View 1 Replies View Related

Software :: Replace A Text String In A File With A Random String - With Sed ?

Sep 2, 2010

I have a line in a text file that has 40 random characters within a tag and i want to change the characters to a new set of 40 random characters (alphanumeric a-z 0-9 etc)

The line in the text file looks like this:

Quote:

How would i go about doing that?

Also second question same as the above but how would i remove them instead of replacing them?

View 14 Replies View Related

Ubuntu :: Put The String Sign Into File / String / Message (rsa)

Mar 7, 2011

I have a String that I would like to sign using a given RSA Private key. I thought this would be relatively easy but I have not been able to find out how to do it, unless I'm looking to far into a simple problem. Do i have to put the string into a file, and sign the file, or can i just sign the string/message?

View 7 Replies View Related

Programming :: Using Sed Replace Line Containing Particular String By A Single String?

Oct 16, 2010

I have a set of lines as ahown below:

Leon went to school
Leon came back from school..
Leon had dinner...

I have to replace the line containing "dinner" by a single string LUNCH...

View 2 Replies View Related

Programming :: Creates String Suffixes Out Of A Reference String?

Feb 25, 2011

I need to creates string suffixes out of a Reference string. for eg. suffixes of abcdefg will be

1)bcdefg
2)cdefg
3)defg
and so on...

create an array of pointers to point to the first few characters and then use that pointer to print the rest of the string.But when i print using the pointer i get GARBAGE values! shudn't std::cout<<ptr[w] print the string following the char it is pointing to? why do i get garbage values?

View 9 Replies View Related

General :: Replace String With Empty String Of Dir Path ?

Apr 2, 2011

I want to replace a string of directory path in a string to empty:

Code:

But this doesnt seem to give me the desired thing:

Code:

This gives the desired outcome, but its specific, i need a variable in the sed not a string. And if I replace STRING="/mnt/sda1/record/$dd/" then I cant use it for something else, cause its has all the weird backslashes now.

View 3 Replies View Related

Programming :: C - Put A Specific Arbitrary Part Of A String Into It's Own String?

Apr 18, 2010

So if I'm given a location of a file like:

How can I just take the type of the file at the end? I know I can use strrchr() for a period to get the pointer to the period just before file type. Is there a build in string function that will just take the rest of the string from a certain point on forward in the string? I know it wouldn't be much work to make it myself, but I figured I would find out if it already existed before doing it.

View 9 Replies View Related

Programming :: Convert String To Integer Back To String C++ ?

Mar 13, 2010

Code:

The error is:

Code:

What I want to do is take input of ip4 as a string, convert it to an integer to add 1 to it, then reconvert it back to a string. Its not working.

My full code is:

Code:

View 1 Replies View Related

Fedora :: Reliable Search Engine For Searching Particular Content On The Files In The Storage Database?

Feb 15, 2010

I'm looking for a simple and reliable search engine for searching particular content on the files in the storage database. The output will display files' name and their path. Google search found following site:- "List of search engines";[URL]..There are many of them. I have no idea how to make my selection. Could you please shed me some light. Furthermore can a simple shell command do the same job?

View 4 Replies View Related

General :: Extract A String Within A String Using A Pattern?

Nov 4, 2010

i have a file name using the following pattern:

PREFIX: AR
SOURCE: LEGACY
DATETIME: YYYYMMDD_HH24MISS
SUFFIX: .txt

sample filename:AR_LEGACY_20101104_105500.txti want to extract the source which is LEGACY in this case. how do i do this using shell?

View 1 Replies View Related

Programming :: Assigning Custom String To Std::string In C++?

Oct 12, 2009

I've been given a custom-made string class which handles string, wstring and bstr. It has a number of methods and assignment operators to convert to and from different types. The app I work on compiles happily in VS6 and VS2008, but when trying to compile in Redhat (version 4.1.1 in Redhat 5.0)

[code]....

View 4 Replies View Related

Programming :: How To Check If All Letters Of One String Are In Another String?

Nov 11, 2010

I have the following two type of strings1: A/D2: A/C/DI am trying to write a subroutine to check whether all of the letters in string 1 appears in string 2. If yes, return true. If not, return false. In the above example, all the letters (A and D) in string 1 are also present in string 2, so I return true.

View 4 Replies View Related

General :: Comparing Resources Using Top?

Apr 6, 2011

Fedora 15 Alpha

3861 user 20 0 904m 128m 33m S 0.7 6.4 1:11.52 xulrunner-bin
1323 user 20 0 1555m 95m 31m S 13.5 4.8 4:06.87 gnome-shell
3494 user 20 0 1028m 50m 21m S 12.8 2.5 1:43.32 evolution

I just wondering what is the difference between RES, SHR, and VIRT.

1) The VIRT always seems to be higher. Is this using the paging file system. (virtual memory on the harddisk, the swap memory)

2) Is the RES memory the actual physical RAM memory?

3) Is shared memory sharing memory with other processes?

4) Just a final question. As I am running on a HP Mini 210, memory and CPU is a resource I don't have a abundence of. So if was to compare for example 2 difference browsers i.e. firefox and midora. What should I brench mark between to 2 to find what one uses less resources?

View 2 Replies View Related

Programming :: Comparing Two Files ?

May 7, 2011

I have two files

Code:

we have to consider here $5 , $6 , $7 for our search

file2.txt

Code:

Here we should take only $2 for comparison. As you can most of the $2 field records has value and some do not have value.

Question:I want to take the fields $5 , $6 , $7 from file 1 and compare it with $2 field from file 2. and the rsult should be like this:

Code:

The final output will look like this

Actual file1.txt (before running the code)

Code:

FIle1.txt after running the above said condition

Code:

So the field $5 , $6 , $7 should get replaced from the matched valued of $1(file1)

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved