Sponsored Content
Top Forums Shell Programming and Scripting grep a string in the lines between 2 strings of a file Post 302332782 by bhagirathi on Friday 10th of July 2009 04:27:27 AM
Old 07-10-2009
hi ghostdog,

it gives the output as
ctp=0
ctp=0
.
..
53 times
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep and delete lines except the lines with strings

Hi I am writing a script which should read a file and search for certain strings 'approved' or 'removed' and retain only those lines that contain the above strings. Ex: file name 'test' test: approved package waiting for approval package disapproved package removed package approved... (14 Replies)
Discussion started by: vj8436
14 Replies

2. Shell Programming and Scripting

How to get lines started with matched strings using sed or grep for loop?

I have a huge file and want to separate it into several subsets. The file looks like: C1 C2 C3 C4 ... (variable names) 1 .... 2 .... 3 .... : 22 .... 23 .... I want to separate the huge file using the column 1, which has numbers from 1 to 23 (but there are different amount of... (8 Replies)
Discussion started by: AMBER
8 Replies

3. Shell Programming and Scripting

grep a string and print strings on that line

i have a file like below ABS 12234 A C 12G CFY 23865 A C 34D i want to grep "A C" then print ABS 12G 12234 CFY 34D 23865 Thanks! (4 Replies)
Discussion started by: kingpeejay
4 Replies

4. UNIX for Dummies Questions & Answers

grep command to find multiple strings in multiple lines in a file.

I want to search files (basically .cc files) in /xx folder and subfolders. Those files (*.cc files) must contain #include "header.h" AND x() function. I am writing it another way to make it clear, I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Discussion started by: ritikaSharma
2 Replies

5. Shell Programming and Scripting

Awk - find string, search lines below string for other strings

What's the easiest way to search a file for a specific string and then look for other instances after that? I want to search for all Virtual Hosts and print out the Server Name and Document Root (if it has that info), while discarding the rest of the info. Basically my file looks like this: ...... (6 Replies)
Discussion started by: Mbohmer
6 Replies

6. Shell Programming and Scripting

replace a string with contents of a txt file containing multiple lines of strings

Hello everyone, ive been trying to replace a string "kw01" in an xml file with the contents of a txt file having multiple lines. im a unix newbie and all the sed combinations i tried resulted to being garbled. Below is the contents of the txt file: RAISEDATTIME --------------------... (13 Replies)
Discussion started by: 4dirk1
13 Replies

7. Shell Programming and Scripting

Delete lines in file containing duplicate strings, keeping longer strings

The question is not as simple as the title... I have a file, it looks like this <string name="string1">RZ-LED</string> <string name="string2">2.0</string> <string name="string2">Version 2.0</string> <string name="string3">BP</string> I would like to check for duplicate entries of... (11 Replies)
Discussion started by: raidzero
11 Replies

8. Shell Programming and Scripting

Grep a string from input file and delete next three lines including the line contains string in xml

Hi, 1_strings file contains $ cat 1_strings /home/$USER/Src /home/Valid /home/Review$ cat myxml <projected value="some string" path="/home/$USER/Src"> <input 1/> <estimate value/> <somestring/> </projected> <few more lines > <projected value="some string" path="/home/$USER/check">... (4 Replies)
Discussion started by: greet_sed
4 Replies

9. Shell Programming and Scripting

Possible to grep string based on surrounding strings?

I was wondering if it was possible to grep a pattern based on the surround text. For example, if i have an input file like this: titleA titleB titlex titleC titleD titlex titleE And I want to grep "title" and save the results only if it is not followed with a "titlex". My output... (14 Replies)
Discussion started by: jl487
14 Replies

10. Shell Programming and Scripting

Single grep to multiple strings with separate output per string

I need to grep multiple strings from a particular file. I found the use of egrep "String1|String2|String3" file.txt | wc-l Now what I'm really after is that I need to separate word count per each string found. I am trying to keep it to use the grep only 1 time. Can you guys help ? ... (9 Replies)
Discussion started by: nms
9 Replies
inviso_rt(3erl) 					     Erlang Module Definition						   inviso_rt(3erl)

NAME
inviso_rt - Direct API to the Inviso Runtime Component DESCRIPTION
The inviso_rt API is normally only used when programming autostart scripts or similar mechanisms. The reason is that the runtime component is part of the Runtime_tools application and will therefore always be available. But the regular inviso API is part of the Inviso applica- tion not necessarily available on the node doing an autostart. It is of course possible to runt a "lean" tracer only using the runtime com- ponent manually (i.e not through autostart). The runtime component shall otherwise be controlled through the control component, which is accessed with the inviso API. EXPORTS
init_tracing(TracerData) -> NodeResult | {error,Reason} See inviso:init_tracing/2 for details. tp(Mod,Func,Arity,MatchSpec,Opts) -> tp(Mod,Func,Arity,MatchSpec) -> NodeResult | {error,Reason} tp(PatternList) -> NodeResult | {error,Reason} Types Mod,Func = atom() | '_' | ModRegExp | {DirRegExp,ModRegExp} ModRegExp = regexp_string() DirRegExp = regexp_string() Arity = int() | '_' MatchSpec = true | false | [] | matchspec() PatternList = [Pattern], Pattern = {Mod,Func,Arity,MatchSpec,Opts} Opts = [Opt] Opt = only_loaded NodeResult = {ok,[Ans]} | {error,Reason} Ans = int() | {error,Reason} Set global trace patterns. The integer replied if the call was successfull describes the number of matched functions. Using wild- cards follows the rules for wildcards of erlang:trace_pattern . It is for instance illegal to specify M=='_' while F is not '_' . Modules can also be specified using Erlang regular expressions as described in the regexp module. If {DirRegExp,ModRegExp} is used, module selection will further be restricted by that the module must be loaded from a location containing DirRegExp somewhere in the path. This can be used to for instance trace on all modules belonging to a certain application. tpl(Mod,Func,Arity,MatchSpec) -> tpl(Mod,Func,Arity,MatchSpec,Opts) -> NodeResult | {error,Reason} tpl(PatternList) -> NodeResult | {error,Reason} See tp/N function above for details on arguments and return values. Set local trace pattern on specified functions. ctp(Mod,Func,Arity) -> NodeResult | {error,Reason} See tp/N for argument descriptions. Clear global trace patterns. ctpl(Mod,Func,Arity) -> NodeResult | {error,Reason} See tp/N for argument description. Clear local trace patterns. tf(PidSpec,FlagList) -> NodeResult | {error,Reason} tf(TraceConfList) -> NodeResult | {error,Reason} Types TraceConfList = [{PidSpec,FlagList}] FlagList = [Flag] PidSpec = all | new| existing | pid() | locally_registered_name() Flag = all process trace flags allowed. NodeResult = {ok,[Ans]} | {error,Reason} Ans = int() | {error,Reason} Set process trace flags. The integer returned if the call was successful describes the matched number of processes. ctf(PidSpec,FlagList) -> NodeResult | {error,Reason} ctf(TraceConfList) -> NodeResult | {error,Reason} See tf/1,2 for arguments and return value description. Clear process trace flags. init_tpm(Mod,Func,Arity,CallFunc) -> NodeResult | {error,Reason} init_tpm(Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> NodeResult | {error,Reason} Types Mod = Func = atom() Arity = int() NodeResult = ok | {error,Reason} InitFunc = RemoveFunc = {Module,Function} | function()/4 | void See inviso:init_tpm/5,7 for details. tpm(Mod,Func,Arity,MS) -> NodeResult | {error,Reason} tpm(Mod,Func,Arity,MS,CallFunc) -> NodeResults | {error,Reason} tpm(Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> NodeResults | {error,Reason} Types Mod = Func = atom() =/= '_' Arity = int() MS = match_spec() InitFunc = CallFunc = ReturnFunc = RemoveFunc = {Module,Function} | function() NodeResult = {ok,1} | {ok,0} | {error,Reason} See inviso:tpm/4,5,8 for details. tpm_tracer(Mod,Func,Arity,MS) -> NodeResult | {error,Reason} tpm_tracer(Mod,Func,Arity,MS,CallFunc) -> NodeResults | {error,Reason} tpm_tracer(Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> NodeResults | {error,Reason} See inviso:tpm_tracer/4,5,8 for details. tpm_ms(Mod,Func,Arity,MSname,MS) ->d NodeResult | {error,Reason} Types Mod = Func = atom() Arity = int() MSname = term() MatchSpec = [match_spec()] NodeResult = {ok,1} | {ok,0} | {error,Reason} See inviso:tpm_ms/5 for details. tpm_ms_tracer(Mod,Func,Arity,MSname,MS) ->d NodeResult | {error,Reason} See inviso:tpm_ms_tracer/5 for details. ctpm_ms(Mod,Func,Arity,MSname) -> NodeResult | {error,Reason} Types NodeResult = ok | {error,Reason} See inviso:ctpm_ms/4 for details. ctpm(Mod,Func,Arity) -> {ok,NodeResults} | NodeResult | {error,Reason} Types NodeResults = [{Node,NodeResult}] NodeResult = ok | {error,Reason} See inviso:ctpm/3 for details. local_register() ->NodeResult | {error,Reason} Types NodeResult = {R1,R2} R1 = R2 = {ok,0} | {ok,1} | {error,Reason} See inviso:tpm_localnames/0 for details. remove_local_register() ->NodeResult | {error,Reason} Types NodeResult = {R1,R2} | {error,Reason} R1 = R2 = ok | {error,Reason} See inviso:ctpm_localnames/0 for details. global_register() ->NodeResult | {error,Reason} Types NodeResult = {R1,R2} | {error,Reason} R1 = R2 = {ok,0} | {ok,1} | {error,Reason} See inviso:tpm_globalnames/0 for details. remove_global_register() ->NodeResult | {error,Reason} Types NodeResult = {R1,R2} | {error,Reason} R1 = R2 = ok | {error,Reason} See inviso:ctpm_globalnames/0 for details. Ericsson AB inviso 0.6.2 inviso_rt(3erl)
All times are GMT -4. The time now is 01:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy