Other than the double trailing space laknar expects after the 1st and 3rd occurrences of </RequestType> and the single trailing space laknar expects after the 2nd occurence of </RequestType>, the following seems to produce the expected output:
This User Gave Thanks to Don Cragun For This Post:
Hi All,
My requisite is to search for the string "0108"(which is the year and has come in the wrong year format) in a particular column say 4th column in a tab delimited file and then replace it with 2008(the correct year format) in the same position where 0108 was found..The issue is the last... (15 Replies)
Hi All,
My requisite is to search for the string "0108"(which is the year and has come in the wrong year format) in a particular column say 4th column in a tab delimited file and then replace it with 2008(the correct year format) in the same position where 0108 was found in the same file..The... (27 Replies)
Hi Guys,
I am trying to write a perl script to search a string "Name" in the file "FILE" and also want to create a new file and push the searched string Name line along with 10 lines following the same.
can anyone of you please let me know how to go about it ? (8 Replies)
What's the easiest way to search a file for a specific string and then look for other instances after that? I want to search for all Virtual Hosts and print out the Server Name and Document Root (if it has that info), while discarding the rest of the info.
Basically my file looks like this:
...... (6 Replies)
Hi
I am looking for a particular string in a file.If the string exists, then I want to replace another string with some other text.Once replaced, search for the same text after that character position in the file. :wall:
E.g: Actual File content:
Hello
Name: Nitin Raj
Welcome to Unix... (4 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)
Need Assistance in shell programming... I have a huge file which has multiple stations and i wanted to search particular station and extract few lines from it and the rest is not needed
Bold letters are the stations . The whole file has multiple stations .
Below example i wanted to search... (4 Replies)
Hi Everyone,
I have a requirement in ksh where i have a set of files in a directory. I need to search each and every file if a particular string is present in the file, delete that line and replace that line with another string expression in the same file.
I am very new to unix. Kindly help... (10 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 DEBIAN
tprintf
PRINTF(9) BSD Kernel Developer's Manual PRINTF(9)NAME
printf, uprintf, tprintf, log -- formatted output conversion
SYNOPSIS
#include <sys/types.h>
#include <sys/systm.h>
int
printf(const char *fmt, ...);
void
tprintf(struct proc *p, int pri, const char *fmt, ...);
int
uprintf(const char *fmt, ...);
#include <sys/syslog.h>
void
log(int pri, const char *fmt, ...);
DESCRIPTION
The printf(9) family of functions are similar to the printf(3) family of functions. The different functions each use a different output
stream. The uprintf() function outputs to the current process' controlling tty, while printf() writes to the console as well as to the log-
ging facility. The tprintf() function outputs to the tty associated with the process p and the logging facility if pri is not -1. The log()
function sends the message to the kernel logging facility, using the log level as indicated by pri.
Each of these related functions use the fmt parameter in the same manner as printf(3). However, printf(9) adds two other conversion speci-
fiers.
The %b identifier expects two arguments: an int and a char *. These are used as a register value and a print mask for decoding bitmasks.
The print mask is made up of two parts: the base and the arguments. The base value is the output base expressed as an integer value; for
example, 10 gives octal and 20 gives hexadecimal. The arguments are made up of a sequence of bit identifiers. Each bit identifier begins
with an integer value which is the number of the bit (starting from 1) this identifier describes. The rest of the identifier is a string of
characters containing the name of the bit. The string is terminated by either the bit number at the start of the next bit identifier or NUL
for the last bit identifier.
The %D identifier is meant to assist in hexdumps. It requires two arguments: a u_char * pointer and a char * string. The memory pointed to
be the pointer is output in hexadecimal one byte at a time. The string is used as a delimiter between individual bytes. If present, a width
directive will specify the number of bytes to display. By default, 16 bytes of data are output.
The log() function uses syslog(3) level values LOG_DEBUG through LOG_EMERG for its pri parameter (mistakenly called 'priority' here). Alter-
natively, if a pri of -1 is given, the message will be appended to the last log message started by a previous call to log(). As these mes-
sages are generated by the kernel itself, the facility will always be LOG_KERN.
RETURN VALUES
The printf() and the uprintf() functions return the number of characters displayed.
EXAMPLES
This example demonstrates the use of the %b and %D conversion specifiers. The function
void
printf_test(void)
{
printf("reg=%b
", 3, "102BITTWO1BITONE
");
printf("out: %4D
", "AAAA", ":");
}
will produce the following output:
reg=3<BITTWO,BITONE>
out: 41:41:41:41
The call
log(LOG_DEBUG, "%s%d: been there.
", sc->sc_name, sc->sc_unit);
will add the appropriate debug message at priority ``kern.debug'' to the system log.
SEE ALSO printf(3), syslog(3)BSD September 8, 2006 BSD