With common commands in Section 2 of this script:
producing:
See temporary files f? for intermediate results, man pages for other details ... cheers, drl
Hi,
I want to grep the line which has 'data11'.then from that line, i need to trace back and find out the immediate line which has the same timestamp of that grepped line.
for eg:
log file:
-----------
Process - data
Process - datavalue - 2345
Process - data
Process - data
Process... (9 Replies)
I am trying to pull certain pieces of data out of a line of a file that matches a certain pattern:
The three pieces that I want to pull out of this line are the only occurrences of that pattern within the line, but the rest of the line is not consistent in each file. Basically the line is... (3 Replies)
I have the following text format in a file which lists the question first and then 5 choices
after that the explanantion and finally the answer.
1.The amount of time it takes for most of a worker’s occupational knowledge and skills to become
obsolete has been declining because of the... (2 Replies)
Hi All,
I am stuck for quite sometime now. Below is a line in my file -
GS|ED|001075|001081|20110626|1806|100803|X|004010ST|130|100803001
This line occurs only once and it is the second line.
I have to break this line into two lines from ST (bold) such that it looks like -... (5 Replies)
Hello every,
I am stuck in a problem. I have file like this. I want to add the fifth field of the match pattern line above the lines starting with "# @D". The delimiter is "|"
eg
>
# @D0.00016870300|0.05501020000|12876|12934|3||Qp||Pleistocene||"3 Qp Pleistocene"|Q
# @P... (5 Replies)
I have a log file as given below
012/01/21 10:29:02 (111111) Processing Job '23_369468343464564'
2012/01/21 10:29:02 (111111)
Making Job '23_369468343464564.0'...
2012/01/21 10:29:04 (111111)
Jobnumber '23_369468343464564' was successful
2012/01/21 10:29:04 ... (12 Replies)
Hello Friends,
I need to print lines in between two string when a keyword existed in those lines (keywords like exception, error, failed, not started etc).
for example,
input:
..
Begin Edr
ab12
ac13
ad14
bc23
exception occured
bd24
cd34
dd44
ee55
ff66
End Edr (2 Replies)
Hi I want to print the line until pattern is matched.
I am using below code:
sed -n '1,/pattern / p' file
It is working fine for me , but its not working for exact match.
sed -n '1,/^LAC$/ p' file
Input:
LACC FEGHRA 0
LACC FACAF 0
LACC DARA 0
LACC TALAC 0
LAC ILACTC 0... (8 Replies)
Hello,
I have below format log file,
Comparing csv_converted_files/2201/9747.1012H67126.5077292103609547345.csv and csv_converted_files/22019/97447.1012H67126.5077292103609547345.csv
Comparing csv_converted_files/2559/9447.1012H67126.5077292103609547345.csv and... (6 Replies)
Hi All,
i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field.
i am using centos 7 Operating system.
want to read below file.
# cat /tmp/d5
NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 Replies
LEARN ABOUT SUNOS
tail
tail(1)tail(1)NAME
tail - deliver the last part of a file
SYNOPSIS
/usr/bin/tail [ +-s number [lbcr]] [file]
/usr/bin/tail [-lbcr] [file]
/usr/bin/tail [ +- number [lbcf]] [file]
/usr/bin/tail [-lbcf] [file]
/usr/xpg4/bin/tail [-f | -r] [-c number | -n number] [file]
/usr/xpg4/bin/tail [ +- number [l | b | c] [f]] [file]
/usr/xpg4/bin/tail [ +- number [l] [f | r] ] [file]
The tail utility copies the named file to the standard output beginning at a designated place. If no file is named, the standard input is
used.
Copying begins at a point in the file indicated by the -cnumber, -nnumber, or +-number options (if +number is specified, begins at distance
number from the beginning; if -number is specified, from the end of the input; if number is NULL, the value 10 is assumed). number is
counted in units of lines or byte according to the -c or -n options, or lines, blocks, or bytes, according to the appended option l, b,
or c. When no units are specified, counting is by lines.
The following options are supported for both /usr/bin/tail and /usr/xpg4/bin/tail. The -r and -f options are mutually exclusive. If both
are specified on the command line, the -f option is ignored.
-b Units of blocks.
-c Units of bytes.
-f Follow. If the input-file is not a pipe, the program does not terminate after the line of the input-file has been copied, but
enters an endless loop, wherein it sleeps for a second and then attempts to read and copy further records from the input-file.
Thus it can be used to monitor the growth of a file that is being written by some other process.
-l Units of lines.
-r Reverse. Copies lines from the specified starting point in the file in reverse order. The default for r is to print the entire
file in reverse order.
/usr/xpg4/bin/tail
The following options are supported for /usr/xpg4/bin/tail only:
-c number The number option-argument must be a decimal integer whose sign affects the location in the file, measured in bytes, to
begin the copying:
+ Copying starts relative to the beginning of the file.
- Copying starts relative to the end of the file.
none Copying starts relative to the end of the file.
The origin for counting is 1; that is, -c+1 represents the first byte of the file, -c-1 the last.
-n number Equivalent to -cnumber, except the starting location in the file is measured in lines instead of bytes. The origin for
counting is 1. That is, -n+1 represents the first line of the file, -n-1 the last.
The following operand is supported:
file A path name of an input file. If no file operands are specified, the standard input is used.
See largefile(5) for the description of the behavior of tail when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes).
Example 1: Using the tail Command
The following command prints the last ten lines of the file fred, followed by any lines that are appended to fred between the time tail is
initiated and killed.
example% tail -f fred
The next command prints the last 15 bytes of the file fred, followed by any lines that are appended to fred between the time tail is initi-
ated and killed:
example% tail -15cf fred
See environ(5) for descriptions of the following environment variables that affect the execution of tail: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
See attributes(5) for descriptions of the following attributes:
/usr/bin/tail
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|CSI |Enabled |
+-----------------------------+-----------------------------+
/usr/xpg4/bin/tail
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWxcu4 |
+-----------------------------+-----------------------------+
|CSI |Enabled |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
cat(1), head(1), more(1), pg(1), dd(1M), attributes(5), environ(5), largefile(5), standards(5)
Piped tails relative to the end of the file are stored in a buffer, and thus are limited in length. Various kinds of anomalous behavior can
happen with character special files.
13 Jul 2005 tail(1)