hi
i need to name a file with a substring of a another file name.
i.e. if the old filename is abc.txt , the new filename should be abc_1.txt
i should get the substring of the file name and then name the new one
please let me know how to do it (4 Replies)
Hi All,
I am trying to extract substring from a variable by using the pattern as var3=${var2:3:3}
var2 is a variable already declared and having the value. From var2 i need to extract 3 characters from 3rd position.
When ever i give the expression var3=${var2:3:3} on shell prompt, the... (3 Replies)
Hi awk and sed gurus,
Please help me in the following.
I have the following entries in the file
ABCDErules
AbHDPrules
ABCrules
--
--
and other entries in the file.
Now, I want to extract from the file that contain entries for *rules and process it separately.
How can i do it... (6 Replies)
Hi,
I would like to extract a substring from a string in unix.
eg:
./checkfile.sh -- i need only checkfile.sh from this string.
Could someone help me out in this...
Regards
Arun (19 Replies)
Hi all,
I need to extract the "abcdef" from the below string Digital_abcdef_20130103.txt.gz
The length of the "abcdef" will be changing but it will be always after the word Digital_ and before the second underscore
help in this regard is highly appreciated (3 Replies)
Hi,
I am new to Unix. I am trying to extract a substring from an input string: Ex -
input string: deploy_v11_9_1
i want to extract and store the value v11_9_1 from the input string in a new variable.
I am using following command in my shell script file:
echo "Enter the folder name u... (5 Replies)
hello.
I get this text when using some command :
S | Name | Type | Version | Arch | Repository
--+-----------------+---------+---------+------+-------------
| AdobeReader_enu | package | 9.5.4-1 | i486 | zypper_local
I need to get "AdobeReader_enu" from the the pattern "Ado"... (7 Replies)
Hi All
I have a line which is as below
1234567 Gagan Paswani zz23432 1000000000 1000000000 ASTHEYXX-RTUC zz23432
I need to extract the first occurence of zz23432 which will have the reg expression as
{2}{5}
Could you please assist as to how I can extract this... (3 Replies)
Hi All,
I'm facing issue wherein I have 2 character string like 'CR' and 'DR' and I want to extract just 1st character but am unable to do it. I tried below options but they are returning me 2nd character only,
var="CR"
echo ${var:1}
returns just "R"
echo ${var:0}
returns "CR"
... (5 Replies)
Discussion started by: arvindshukla81
5 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)