Grep command in Linux in a script where the search string has a space
I have a file xyz with the following content
I also have another file named MasterFile where it contains the above mentioned data million times with different digits at the end for example some times it contains SEND 9999 or WENT 9898 or POFT 7898
Sample MasterFile
I am writing my script as the following
even when I put the double quotes around
it doesnt work Can I get some help please
Hi,
I want to grep one file for a search string and get the next 10 lines after the search string.
for eg,in file tnsnames.ora,i have 100 entries.i want to search for one string and get the entry for that db.
please help how to acheive this using awk or sed?
Thanks. (11 Replies)
Hi,
i have to search for a char like that :
export var1="i am not happy /not happy"
with a command like :
grep $var1 file
but this not working with me !!!
thank you in advance. (2 Replies)
Hi,
I am trying to grep a string which has two words separated by space.
I used a script to grep the string by reading the string in to a variable
command i used in the script is
echo "enter your string"
read str
grep $str <file>
it is working fine when the entered string is a single... (3 Replies)
hi!
i'm trying to get grep to do an exact match for the following pattern but..it's not quite working. I'm not too sure where did I get it wrong. any input is appreciated.
echo "$VAR" | grep -q '^test:]name'
if ; then
printf "test name is not found \n"
fi
on... (4 Replies)
Hey guys,
I'm having a bit of trouble getting this to work using either sed or grep. It's possible awk might be the ticket I need as well, but my regulat expression skills aren't quite up to the task for doing this.
I'm looking to grep for the string ERROR from the following log up until any... (6 Replies)
I want to write the syntax so does not count line with no space.
So currerntly it is showing lines as 5, but i want to show 4.
# cat /tmp/mediacheck | sort -u | grep -vi " " | awk '{print $1}' | wc -l
BA7552
BAA002
BAA003
BAA004 (6 Replies)
I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios.
Cat test
Nov 10, 2012 5:17:53 AM
INFO: Request Type
Line 1.... (5 Replies)
Hello,
one step in a shell script i am writing, involves Grep command to search a regular expression in a line an only print the string after the match
an example line is below
/logs/GRAS/LGT/applogs/lgt-2016-08-24/2016-08-24.8.log.zip:2016-08-24 19:12:48,602 ERROR... (9 Replies)
So, there is a large file where I have to conduct several search using bash shell scripting.
The file is like this:
TITLE and AUTHOR ETEXT NO. Aspects of plant life; with special reference to the British flora, 56900 by Robert Lloyd... (1 Reply)
Lets say I have a massive directory which is filled with other directories all filled with different c++ scripts and I want a listing of all the scripts that contain the string: "this string". Is there a way to use a grep search for that? I tried:
grep -lr "this string" *
but I do not... (3 Replies)
Discussion started by: Circuits
3 Replies
LEARN ABOUT CENTOS
xterrormsg
XtErrorMsg(3) XT COMPATIBILITY FUNCTIONS XtErrorMsg(3)NAME
XtErrorMsg, XtSetErrorMsgHandler, XtWarningMsg, XtSetWarningMsgHandler - high-level error handlers
SYNTAX
void XtErrorMsg(String name, String type, String class, String default, String *params, Cardinal *num_params);
void XtSetErrorMsgHandler(XtErrorMsgHandler msg_handler);
void XtSetWarningMsgHandler(XtErrorMsgHandler msg_handler);
void XtWarningMsg(String name, String type, String class, String default, String *params, Cardinal *num_params);
ARGUMENTS
class Specifies the resource class.
default Specifies the default message to use.
name Specifies the general kind of error.
type Specifies the detailed name of the error.
msg_handler
Specifies the new fatal error procedure, which should not return or the nonfatal error procedure, which usually returns.
num_params
Specifies the number of values in the parameter list.
params Specifies a pointer to a list of values to be stored in the message.
DESCRIPTION
The XtErrorMsg function has been superceded by XtAppErrorMsg.
The XtSetErrorMsgHandler function has been superceded by XtAppSetErrorMsgHandler.
The XtSetWarningMsgHandler function has been superceded by XtAppSetWarningMsgHandler.
The XtWarningMsg function has been superceded by XtAppWarningMsg
SEE ALSO XtAppErrorMsg(3)
X Toolkit Intrinsics - C Language Interface
Xlib - C Language X Interface
X Version 11 libXt 1.1.4 XtErrorMsg(3)