Hi all
I have the problem to substitute a string with newline in Perl. Can anybody help me?
And also how to replace a string with opening bracket (e.g. (START ) with a whitespace/null character?
Thanks in advance. (1 Reply)
I want to replace a text string with a newline. I have a long text file of random characters. I want to replace all the occurences of "pe" with a newline. How can I do that in Unix? There's a thread from 2004 saying that you can do something like this with sed by actually pressing the return... (1 Reply)
Hi, I'm very new to shell scripting and have searched google and this forum for quite some time now.
I have the following in my xml file:
<recipients>
<member>value1</member>
</recipients>
I need to find a string <recipients> that follows with a new-line and bunch of spaces and... (5 Replies)
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Hi,
I'm struggling with a string replacement.
I have an XML file which is in the following layout
<FUNCTION>
<PRODUCTS>
<PRODUCT CODE="PRODUCE" ACTION="amend" VALIDATE="no">
<SUPPLIER PRODUCT="PRODUCT" ACTION="amend" CODE="SUPPLIER">
<STOCK_QUANTITY DATA="21"/>
... (15 Replies)
I have a string like below:
{\rtf1\fbidis\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}{\f1\fnil MS Sans Serif;}}
\viewkind4\uc1\pard\ltrpar\lang2057\f0\fs16 19/11/2010 SOME DESCRIPTION. \par
\lang1033\f1\par
}
I have to replace the newline character with null in the... (8 Replies)
Hi,
I am trying to do some transformation on a large file and I am getting some troubles trying remove newlines only when the last character of a line is a symbol (in this case is a pipe "|").
I have tried with sed like this:
sed -i 's/|\n/|/g' my_file
or
sed -i 's/|$/|/gg' my_file... (5 Replies)
I have the below string which i need to compare with a file and replace this string in the file which matches closely. Can anyone help me on this.
string(Scenario 1)- user::r--,user::ourfrd:r--
String(Scenario 2)- user::r--
File
****
# file: /local/Desktop/myfile
# owner: me
# group:... (6 Replies)
Discussion started by: sarathy_a35
6 Replies
LEARN ABOUT NETBSD
do_setresuid
DO_SETRESUID(9) BSD Kernel Developer's Manual DO_SETRESUID(9)NAME
do_setresuid, do_setresgid -- set process uid and gid
SYNOPSIS
#include <sys/ucred.h>
int
do_setresuid(struct lwp *lwp, uid_t ruid, uid_t euid, uid_t svuid, u_int flags);
int
do_setresgid(struct lwp *lwp, uid_t ruid, uid_t euid, uid_t svuid, u_int flags);
DESCRIPTION
The do_setresuid and do_setresgid functions are used to implement the various system calls that allow a process to change its real, effec-
tive, and saved uid and gid values.
The do_setresuid function sets the specified processes real user ID to ruid, its effective user ID to euid, and its saved user ID to svuid.
If any of the uid arguments are -1 then that assignment is skipped.
If suser() is true, then any values may be assigned, otherwise the new uid values must match one of the existing values and the caller must
have set the relevant bit in flags.
The flags argument specifies which of the existing uid values the new value must match. It should be set to a logical OR of
ID_{R,E,S}_EQ_{R,E,S}, where ID_E_EQ_R means that it is valid to set the effective ID to the current value of the real ID.
The do_setresgid function sets the group IDs but otherwise behaves in the same manner as do_setresuid. The processes group list is neither
examined nor effected.
SEE ALSO setregid(2), setreuid(2), setuid(2), suser(9)CODE REFERENCES
These functions are implemented in: sys/kern/kern_prot.c.
HISTORY
Implemented for NetBSD 2.0 to replace ad-hoc code in each system call routine and in the various compat modules.
BSD September 28, 2003 BSD