I want to search a file for a string and then if the string is found I need the line that the string is on - but also the previous two lines from the file (that the pattern will not be found in)
This is on solaris
Can you help? (2 Replies)
Hi,
I am new to this forum and i would like to get help in this issue.
I have a file 1.txt as shown:
apple
banana
orange
apple
grapes
banana
orange
grapes
orange
....
Now i would like to search for pattern say apple or orange and then put a # at the beginning of the pattern... (2 Replies)
Hi,
I think you ppl did not get my question correctly, let me explain
I have 1.txt with following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433
**
**
**
In file 2.txt I have the following entries as shown:
... (1 Reply)
I am trying to do some thing like this ..
In a file , if pattern found insert new pattern at the begining of the line containing the pattern.
example:
in a file I have this.
gtrow0unit1/gctunit_crrownorth_stage5_outnet_feedthru_pin
if i find feedthru_pin want to insert !! at the... (7 Replies)
Hi all,
I am trying to extract the values ( text between the xml tags) based on the Order Number.
here is the sample input
<?xml version="1.0" encoding="UTF-8"?>
<NJCustomer>
<Header>
<MessageIdentifier>Y504173382</MessageIdentifier>
... (13 Replies)
I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported
Input file is a free flowing file without any format
example of output
ERR-00001=5
....
ERR-01010=10
.....
ERR-99999=10 (4 Replies)
Hi,
I have two files file1.txt and file2.txt. Please see the attachments.
In file2.txt (which actually is a diff output between two versions of file1.txt.), I extract the pattern corresponding to 1172c1172. Now ,In file1.txt I have to search for this pattern 1172c1172 and if found, I have to... (9 Replies)
Hi,
I've written a script to search for an Oracle ORA- error on a log file, print that line and the .trc file associated with it as well as the dateline of when I assumed the error occured. In most it is the first dateline previous to the error.
Unfortunately, this is not a fool proof script.... (2 Replies)
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
LEARN ABOUT X11R4
rstart
RSTART(1) General Commands Manual RSTART(1)NAME
rstart - a sample implementation of a Remote Start client
SYNOPSIS
rstart [-c context] [-g] [-l username] [-v] hostname command args ...
DESCRIPTION
Rstart is a simple implementation of a Remote Start client as defined in "A Flexible Remote Execution Protocol Based on rsh". It uses rsh
as its underlying remote execution mechanism.
OPTIONS -c context
This option specifies the context in which the command is to be run. A context specifies a general environment the program is to
be run in. The details of this environment are host-specific; the intent is that the client need not know how the environment must
be configured. If omitted, the context defaults to X. This should be suitable for running X programs from the host's "usual" X
installation.
-g Interprets command as a generic command, as discussed in the protocol document. This is intended to allow common applications to
be invoked without knowing what they are called on the remote system. Currently, the only generic commands defined are Terminal,
LoadMonitor, ListContexts, and ListGenericCommands.
-l username
This option is passed to the underlying rsh; it requests that the command be run as the specified user.
-v This option requests that rstart be verbose in its operation. Without this option, rstart discards output from the remote's rstart
helper, and directs the rstart helper to detach the program from the rsh connection used to start it. With this option, responses
from the helper are displayed and the resulting program is not detached from the connection.
NOTES
This is a trivial implementation. Far more sophisticated implementations are possible and should be developed.
Error handling is nonexistent. Without -v, error reports from the remote are discarded silently. With -v, error reports are displayed.
The $DISPLAY environment variable is passed. If it starts with a colon, the local hostname is prepended. The local domain name should be
appended to unqualified host names, but isn't.
The $SESSION_MANAGER environment variable should be passed, but isn't.
X11 authority information is passed for the current display.
ICE authority information should be passed, but isn't. It isn't completely clear how rstart should select what ICE authority information
to pass.
Even without -v, the sample rstart helper will leave a shell waiting for the program to complete. This causes no real harm and consumes
relatively few resources, but if it is undesirable it can be avoided by explicitly specifying the "exec" command to the shell, eg
rstart somehost exec xterm
This is obviously dependent on the command interpreter being used on the remote system; the example given will work for the Bourne and C
shells.
SEE ALSO rstartd(1), rsh(1), A Flexible Remote Execution Protocol Based on rsh
AUTHOR
Jordan Brown, Quarterdeck Office Systems
X Version 11 rstart 1.0.4 RSTART(1)