Hi,
I'm new to unix and i am kind of familiar with the basic commands.
can anyone suggest some good books especially for AWK scripting and SHELL scripting
thanks,
Hari (2 Replies)
I have a text file in which the text has been divided into paragraphs (two line breaks or tab marks a new paragraph) and I want to make a script which output would delete line breaks within the paragraph and the different paragraphs would be separated by two line breaks.
So, if my input file... (14 Replies)
Hi,
I am trying to understand what is happening here, new to scripting: I have a couple of these, but if I knew what was going on in one I can figure out the rest:
awk '/rpc-100083/ { $2 = "enable -r" }
$3 ~ /.NOS99dtlogin/ { $t = $2; $2 = $3; $3 = $t }
{ print }' /var/svc/profile/upgrade... (2 Replies)
Hi
I have 2 files of large size( 10 Miilions) , i want to join 2 files based on some condition .
for this taking lot of time and 100 cpu .i want to iterate the based on some value (like 1 lakh)
I put the 2 files in the associative arrays . if the array limit reaches the 1 lach join the with... (2 Replies)
Hi Experts,
I am adding a column of numbers with awk , however not getting correct output:
# awk '{sum+=$1} END {print sum}' datafile
2.15291e+06
How can I getthe output like : 2152910
Thank you..
# awk '{sum+=$1} END {print sum}' datafile
2.15079e+06 (3 Replies)
Hi, i am newbie to this site and hope to learn but problem is s but need help urgently.
Plz pm me if you are good at this.
Help will be appreciated. (11 Replies)
Hi,
This is the first time I am working with awk and I am not familiar with any commands in it. But I managed to do most of my work just left with one more. Needing your help!
I have to extract only the matrix (written within ) from a text file. For example:
1JTJ_0006_ACGC_NPNP_A_12_15.pdb ... (17 Replies)
hi all,
I am working on awk scripting.I have created two awk files and now have a requirement of replacing the contents of first file with some contents of second file.
Please find below the two files created.File1 has 3 records and File2 has 4 records.
cat File1
111,0165,CB21031251,0165,... (3 Replies)
Hi
I am beginner of shell/AWK scripting , can you please help me in select particular column and column between two pattern from a multiple column file.
file1.txt
number status date1 date2 description category ... (7 Replies)
I am trying to write a shell script that will add a date to and awk command from the command prompt.
here is the line I am having difficulties.
zgrep -i playback $dir/$1-*-errors.out.gz |cut -d '|' -f 1,11,12,15 | awk -v start=${start} -v end=${end} -F '|' '{$1>=start && $1 <=end} {print $2... (7 Replies)
Discussion started by: infinity0880
7 Replies
LEARN ABOUT SUNOS
addseverity
addseverity(3C) Standard C Library Functions addseverity(3C)NAME
addseverity - build a list of severity levels for an application for use with fmtmsg
SYNOPSIS
#include <fmtmsg.h>
int addseverity(int severity, const char *string);
DESCRIPTION
The addseverity() function builds a list of severity levels for an application to be used with the message formatting facility fmtmsg().
The severity argument is an integer value indicating the seriousness of the condition. The string argument is a pointer to a string
describing the condition (string is not limited to a specific size).
If addseverity() is called with an integer value that has not been previously defined, the function adds that new severity value and print
string to the existing set of standard severity levels.
If addseverity() is called with an integer value that has been previously defined, the function redefines that value with the new print
string. Previously defined severity levels may be removed by supplying the null string. If addseverity() is called with a negative number
or an integer value of 0, 1, 2, 3, or 4, the function fails and returns -1. The values 0-4 are reserved for the standard severity levels
and cannot be modified. Identifiers for the standard levels of severity are:
MM_HALT Indicates that the application has encountered a severe fault and is halting. Produces the print string HALT.
MM_ERROR Indicates that the application has detected a fault. Produces the print string ERROR.
MM_WARNING Indicates a condition that is out of the ordinary, that might be a problem, and should be watched. Produces the print
string WARNING.
MM_INFO Provides information about a condition that is not in error. Produces the print string INFO.
MM_NOSEV Indicates that no severity level is supplied for the message.
Severity levels may also be defined at run time using the SEV_LEVEL environment variable (see fmtmsg(3C)).
RETURN VALUES
Upon successful completion, addseverity() returns MM_OK. Otherwise it returns MM_NOTOK.
EXAMPLES
Example 1: Example of addseverity() function.
When the function call
addseverity(7,"ALERT")
is followed by the call
fmtmsg(MM_PRINT, "UX:cat", 7, "invalid syntax", "refer to manual",
"UX:cat:001")
the resulting output is
UX:cat: ALERT: invalid syntax
TO FIX: refer to manual UX:cat:001
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO fmtmsg(1), fmtmsg(3C), gettxt(3C), printf(3C), attributes(5)SunOS 5.10 29 Dec 1996 addseverity(3C)