Hi
My orginal file is like (100s of lines)
id host ip location remarks
1 host1 ip1 - xxx
2 host2 ip2 - xxx
3 host3 ip3 - xxx
--
--
9 host9 ip9 - xxx
I have a ref file like
host1 location1
host2 location2
host3 location3
--
--... (6 Replies)
Hi,
I want to replace a column in a file if it matches certain pattern. Can you help me on this.
Here is the file content.
000000 1111111 2222222
011111 0123445 1234556
023445 1111111 2343455
if second column contains 1111111 i need to replace it with 0000000
Can you... (6 Replies)
Hi,
I'm attempting to rename some files that have spaces in them. Without linking sed commands together is it possible to replace the first three "." to " ".
File.name.is.long.ext -> File name is long.ext
I can get the desired effect with
echo "File.name.is.long.ext" | sed 's/\./ /g;s/... (5 Replies)
Can anyone please help with this? I have 2 files as given below.
If 2nd column of file1 has pattern foo1@a, find the matching 1st column in file2 & replace 2nd column of file1 with file2's value.
file1
abc_1 foo1@a ....
abc_1 soo2@a ...
def_2 soo2@a ....
def_2 foo1@a ........ (7 Replies)
Hi all,
I have two files with the following format:
file1
BBB;33
AAA;2
CCC;5
file2
5;.;.;.
33;.;.;.
The first file contain a list of code and numbers. The second file only the number.
I would like to replace the corresponding code in the first column of the file1 with the... (3 Replies)
Input file:
ASD_QAW 12 A_@
AE_AQ 21 PA_123
ASDA_@ 23 ADA_AS
.
.
Output file:
ASD_QAW 12 A @
AE_AQ 21 PA 123
ASDA_@ 23 ADA AS
.
.
Do anybody know how to just specific and replace "_" in column 3 with tab delimiter (\t)?
Thanks for advice. (2 Replies)
Hi,
I am looking to replacing value of a specific column of /etc/pam.d/system-auth file. My file looks like this
password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok
expected result
password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok... (5 Replies)
I have a file
cat 1.txt
AAAA , BBBB , CCCC , DDDD
DFDF , DFDF , DFDF , FDDD
AA11 , DFDF , 0000 , UTIO
ADSD , WERT, 0000 , JKJL
If the 3rd column is not equal to "0000" , then it should replace "0000" with "XXXX" and if its equal to "0000" then print the line as it is.
need help. (9 Replies)
Have Pipe Delimited File:
> BRYAN BAKER|4/4/2015|518 VIRGINIA AVE|TEST
> JOE BAXTER|3/30/2015|2233 MockingBird RD|ROW2On 3rd column where the address is located, I want to add a space after every numeric value - basically doing a "s//&\ / ":
> BRYAN BAKER|4/4/2015|5 1 8 VIRGINIA AVE|TEST
> JOE... (5 Replies)
I have a XML file where there is a tag with like
<wd:address_line_1>1234 Street</wd:address_line_1>
I want to replace the values "1234 Street" with "Test Data". Different people have different address lines and i want to replace with a fixed value to mask the file. I was trying to use sed... (7 Replies)
Discussion started by: dr46014
7 Replies
LEARN ABOUT OPENSOLARIS
ssignal
ssignal(3C) Standard C Library Functions ssignal(3C)NAME
ssignal, gsignal - software signals
SYNOPSIS
#include <signal.h>
void(*ssignal (int sig, int (*action)(int)))(int);
int gsignal(int sig);
DESCRIPTION
The ssignal() and gsignal() functions implement a software facility similar to signal(3C). This facility is made available to users for
their own purposes.
ssignal()
Software signals made available to users are associated with integers in the inclusive range 1 through 17. A call to ssignal() associates a
procedure, action, with the software signal sig; the software signal, sig, is raised by a call to gsignal(). Raising a software signal
causes the action established for that signal to be taken.
The first argument to ssignal() is a number identifying the type of signal for which an action is to be established. The second argument
defines the action; it is either the name of a (user-defined) action function or one of the manifest constants SIG_DFL (default) or SIG_IGN
(ignore). The ssignal() function returns the action previously established for that signal type; if no action has been established or the
signal number is illegal, ssignal() returns SIG_DFL.
gsignal()
The gsignal() raises the signal identified by its argument, sig.
If an action function has been established for sig, then that action is reset to SIG_DFL and the action function is entered with argument
sig. The gsignal() function returns the value returned to it by the action function.
If the action for sig is SIG_IGN, gsignal() returns the value 1 and takes no other action.
If the action for sig is SIG_DFL, gsignal() returns the value 0 and takes no other action.
If sig has an illegal value or no action was ever specified for sig, gsignal() returns the value 0 and takes no other action.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO raise(3C), signal(3C), attributes(5)SunOS 5.11 29 Dec 1996 ssignal(3C)