Can some body tell me how to print number of line from a particular file, with sed. ?
Input file format
AAAA
BBBB
CCCC
SDFFF
DDDD
DDDD
Command to print line 2 and 3 ?
BBBB
CCCC
And also please tell me how to assign column sum to variable.
I user the following command it... (1 Reply)
Is there a way to tell awk to ignore the first 11 lines of a file?? example, I have a csv file with all the heading information in the first lines. I want to split the file into 5-6 different files but I want to retain the the first 11 lines of the file.
As it is now I run this command:
... (8 Replies)
hi,
I have a shell script that searches for a particular pattern in all the files inside a directory, and gives the count of that pattern occurences in a file.
Now i should not count the pattern if it exists in side a { .... }, as shown below.
{
......
.....
.... PATTERN1.......... (1 Reply)
Hi,
I have a file:
file.txt
1 word
2 word
word
word
3 word
4 word
and I would like to create a set:
set number = `cut -d" " -f1 ${1}` #${1} is the text file
but it should only contain the lines which begin with numbers,
and another set which contains the lines which begin with... (10 Replies)
Im trying to ssh to a remote machine to grep 'x info' *.log and Im able to get the grep output as expected but "after" the policies (1st 14 lines) - I need to skip the first 14 lines.
Its SunOS.
Plz help??? (1 Reply)
Im trying to ssh to a remote machine to grep 'x info' *.log and Im able to get the grep output as expected but "after" the policies (1st 14 lines) - I need to skip the first 14 lines.
Its SunOS.
Plz help??? (7 Replies)
How do I get the last NR of a csv file?
If I use the line
awk -F, '{print NR}' csvfile.csv
and there are 42 lines, I get:
...
39
40
41
42
How do I extract the last number, which in this case is 42?
---------- Post updated at 11:05 AM ---------- Previous update was at 10:57 AM... (1 Reply)
I want to run my shell script to the limit number.Suppose I know in advance that MAX=5 then I want that my script run 5 times only.Something like below$ vi testingMAX=5COMMAND="ssh -l stpuser VHLDVWSAD001 /projects/st/utils/deploy/deployall.sh >/dev/null 2>&1 &" ; sleep 20;count=0while... (2 Replies)
I am trying to output all lines in a file where $7 is less than 30. The below code does create a result file, but with all lines in the original file. The original file is tab deliminated is that the problem? Thank you :).
awk 'BEGIN{FS=OFS=","} $7 < 30 {print}' file.txt > result.txt... (3 Replies)
I am trying to use awk skip each line with a ## or # and check each line after for STB= and if that value in greater than or = to 0.8, then at the end of line the text "STRAND BIAS" is written in else "GOOD".
So in the file of 4 entries attached.
awk tried:
awk NR > "##"' "#" -F"STB="... (6 Replies)
Discussion started by: cmccabe
6 Replies
LEARN ABOUT SUNOS
dmiregisterci
DmiRegisterCi(3DMI) DMI Library Functions DmiRegisterCi(3DMI)NAME
DmiRegisterCi, DmiUnregisterCi, DmiOriginateEvent - Service Provider functions for components
SYNOPSIS
cc [ flag... ] file... -lci -ldmi -lnsl -lrwtool [ library... ]
#include <server.h>
#include <ciapi.h>
extern bool_t DmiRegisterCi(DmiRegisterCiIN argin, DmiRegisterCiOUT *result, DmiRpcHandle *dmi_rpc_handle);
bool_t DmiUnregisterCi(DmiUnregisterCiIN argin, DmiUnregisterCiOUT *result, DmiRpcHandle *dmi_rpc_handle);
bool_t DmiOriginateEvent(DmiOriginateEventIN argin, DmiOriginateEventOUT *result, DmiRpcHandle *dmi_rpc_handle);
DESCRIPTION
These functions provide component communication with the DMI through the Component Interface (CI).
Component instrumentation code may register with the Service Provider to override its current mechanism for the registered attributes.
Instead of manipulating the data in the MIF database or invoking programs, the Service Provider calls the entry points provided in the
registration call. Once the component unregisters, the Service Provider returns to a normal method of processing requests for the data as
defined in the MIF. Component instrumentation can temporarily interrupt normal processing to perform special functions.
Registering attributes through the direct interface overrides atttributes that are already being served through the direct interface. RPC
is used for communication from the Service Provider to the component instrumentation.
For all three functions, argin is the parameter passed to initiate an RPC call, result is the result of the RPC call, and dmi_rpc_handle is
an open session RPC handle.
The DmiRegisterCi() function registers a callable interface for components that have resident instrumentation code and/or to get the ver-
sion of the Service Provider.
The DmiUnregisterCi() function communicates to the Service Provider to remove a direct component instrumentation interface from the Service
Provider table of registered interfaces.
The DmiOriginateEvent() function originates an event for filtering and delivery. Any necessary indication filtering is performed by this
function (or by subsequent processing) before the event is forwarded to the management applications.
A component ID value of zero(0) specifies the event was generated by something that has not been installed as a component, and has no
component ID.
RETURN VALUES
The DmiRegisterCi() function returns the following possible values:
DMIERR_NO_ERROR
DMIERR_ILLEGAL_HANDLE
DMIERR_OUT_OF_MEMORY
DMIERR_INSUFFICIENT_PRIVILEGES
DMIERR_SP_INACTIVE
DMIERR_ATTRIBUTE_NOT_FOUND
DMIERR_COMPONENT_NOT_FOUND
DMIERR_GROUP_NOT_FOUND
DMIERR_DATABASE_CORRUPT
DMIERR_OUT_OF_MEMORY
DMIERR_ILLEGAL_DMI_LEVEL
The DmiUnregisterCi() function returns the following possible values:
DMIERR_NO_ERROR
DMIERR_ILLEGAL_HANDLE
DMIERR_OUT_OF_MEMORY
DMIERR_INSUFFICIENT_PRIVILEGES
DMIERR_SP_INACTIVE
DMIERR_UNKNOWN_CI_REGISTRY
The DmiOriginateEvent() function returns the following possible values:
DMIERR_NO_ERROR
DMIERR_ILLEGAL_HANDLE
DMIERR_OUT_OF_MEMORY
DMIERR_INSUFFICIENT_PRIVILEGES
DMIERR_SP_INACTIVE
DMIERR_UNKNOWN_CI_REGISTRY
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO attributes(5)SunOS 5.10 17 Dec 1996 DmiRegisterCi(3DMI)