Hi,
I am not sure how to start doing this so I hope to get some advice as to how to start.
I have 2 files. The source file contains data that I needed is in columns delimited by ";". For example, in this format:
"CONTINENT","COUNTRY","CITY","ID"
"asia","japan","tokyo","123"... (21 Replies)
Give shell script....which takes two file names as input and compares the contents, is both are same delete second file's contents.....
I try with "diff"...... but confusion how to use "diff" with if ---else
Thanking you (5 Replies)
Hi,
I want to delete the contents of a file which are matching with contents of other file in shell scripting.
Ex.
file1
sheel,sumit,1,2,3,4,5,6,7,8
sumit,rana,2,3,4,5,6,7,8,9
grade,pass,2,3,4,5,6,232,1,1
name,sur,33,1,4,12,3,5,6,8
sheel,pass,2,3,4,5,6,232,1,1
File2... (3 Replies)
Hi,
I am facing issue while reading data from a file in UNIX. my requirement is to compare two files and for the text pattern matching in the 1st file, replace the contents in second file by the contents of first file from start to the end and write the contents to thrid file.
i am able to... (2 Replies)
Hi so far I created this script:
vi loop.beta.sh
for i in `cat extract.filenames.tabc`
do
echo $i
done>$i
===
This is the original text file.
$ more tabc.txt
-rwx------- 1 alice staff 1586 2010-11-05 02:27 request-key
.conf
-rwx------- 1 ted staff 126 ... (3 Replies)
FILE_ID extraction from file name and save it in CSV file after looping through each folders
My files are located in UNIX Server, i want to extract file_id and file_name from each file .and save it in a CSV file. How do I do that?
I have folders in unix environment, directory structure is... (15 Replies)
Hi All,
Please help.
I have got a file which contains a listing of a file and some directories after it, one by one. I am calling this file xyz.txt here
file1
dir1
dir2
dir3
dir4
file2
dir5
dir6
dir7
dir8
file3
dir9
dir10
dir11
dir12 (6 Replies)
Hi,
I am doing something basic, but I am missing something. Im trying to read the contents of a file and taking those values and connecting to a database. However, it only connect to one (or reads in) value and then exists.
Here is what it looks like:
listname.txt
db1
db2
db3
Script:... (15 Replies)
Hi one of the output of the command is as below
# sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/'
Resource List : <br>
*************************** 1. row ***************************<br>
... (2 Replies)
Hi all,
I am trying to loop through the string contents of an array, to add it during the saving of the output files. I am trying this code to print each column and save it to unique file name, but it doesn't work. Thanks for any help.
fnam=(japan usa uk)
alldata.dat contained sample data... (1 Reply)
Discussion started by: ida1215
1 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