9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Team,
I have an issue to split the file which is having special chracter(German Char) using awk command.
I have a different length records in a file. I am separating the files based on the length using awk command.
The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
2. Shell Programming and Scripting
We usually use the following awk code to delete of find out the replicate record.
awk -F, '{a++} END {for (i in a) if (a>=2) print i a}' file
My question is how can I print the whole record. The following code doesn't work.
awk -F, '{a++} END {for (i in a) if (a>=2) print $0}' file
... (8 Replies)
Discussion started by: xshang
8 Replies
3. Shell Programming and Scripting
Hi,
The record length may be differ in afile. I want to display the records if the record length is not equal to 50 using sed/awk command.
Thanks in Advance (6 Replies)
Discussion started by: NareshN
6 Replies
4. Shell Programming and Scripting
Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types:
(H)eader Records
(D)etail Records
(T)railer Records
The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies
5. UNIX for Dummies Questions & Answers
I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies
6. Shell Programming and Scripting
Hi Friends,
Need some help in AWK.
Working on AIX 5
Have been trying the following functionality to make the record length fixed:
if( length(record) < 300 )
{
printf("%-300s\n", record);
}
In my opinion it will apply some fillers in the end.
Its is not making any... (4 Replies)
Discussion started by: kanu_pathak
4 Replies
7. Shell Programming and Scripting
Hi ,
I have a file named "sample" having the data as follows.
"663005487","USD",0,1,"NR"
If i give like
a=`awk -F ',' '{printf length($2)}' sample`
(Trying to find length of second field)I should get the output for the above as 3 (Omitting double quotes) not 5.
How to do this..... (2 Replies)
Discussion started by: jayakumarrt
2 Replies
8. Shell Programming and Scripting
Hi All,
I have a txt file which is an export of a query result from the database. The txt file contains 'Processid#sqlquery' from the database table.As the sqlquery is too long.... i am unable to get the fields seperated using the awk script as below:-
cat sql.txt | awk -F'#' '{printf $2}'... (2 Replies)
Discussion started by: venkatajay_18
2 Replies
9. UNIX for Advanced & Expert Users
Hello -
QUESTION:
Is there a way to override the default record length limitation over awk in Unix?
Or, is there a better way to do what I am trying to do than the way I am trying to do it now? (See BACKGROUND and CURRENT PROCEDURE below...)
BACKGROUND:
In a Kornshell script, I have... (1 Reply)
Discussion started by: JLandry
1 Replies
audit(2) audit(2)
NAME
audit - write a record to the audit log
SYNOPSIS
cc [ flag ... ] file ... -lbsm -lsocket -lnsl [ library... ]
#include <sys/param.h>
#include <bsm/libbsm.h>
int audit(caddr_t record, int length);
The audit() function is used to write a record to the system audit log. The data pointed to by record is written to the log after a mini-
mal consistency check, with the length parameter specifying the size of the record in bytes. The data should be a well-formed audit
record as described by audit.log(4).
The kernel validates the record header token type and length, and sets the time stamp value before writing the record to the audit log.
The kernel does not do any preselection for user-level generated events. If the audit policy is set to include sequence or trailer
tokens, the kernel will append
them to the record.
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.
The audit() function will fail if:
EFAULT The record argument points outside the process's allocated address space.
EINVAL The record header token ID is invalid or the length is either less than the header token size or greater than MAXAUDIT-
DATA.
EPERM The {PRIV_PROC_AUDIT} privilege is not asserted in the effective set of the calling process.
USAGE
Only privileged processes can successfully execute this call.
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Stable |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
bsmconv(1M), auditd(1M), auditon(2), auditsvc(2), getaudit(2), audit.log(4), attributes(5), privileges(5)
The functionality described in this man page is available only if the Basic Security Module (BSM) has been enabled. See bsmconv(1M) for
more information.
31 Mar 2005 audit(2)