This can be done in two steps, one to extract the strings token=number and another to sum the individual items:
producing:
See the intermediate file f1 for the extracted strings, and see man pages for other details ... cheers, drl
I have a small problem,
I have written a following script, which extracts all the rows from source file which strats with T101 and rights it to another file mydata.dat
Script my_script
#!/bin/ksh
YMONTH=$1
dir1='/home/data'
dir2='/clients/source_file'
cd $dir1
grep "T101"... (5 Replies)
Hello all,
Iam newbie here and to unix programming. I have the following text file.
A:Woshington,B:London,C:Paris,D:Manchester,C:Lisbon,E:Cape town.
Now I would like extract this and store in database. here is the script I have tried but it did work.
CITY1:`echo "$text" | grep "A:"... (11 Replies)
Hi All,
I have a requirement where I have to search the file with some text say "Exception". This exception word can be repeated for more then 10 times.
Suppose the "Exception" word is repeated at line numbers say x=10, 50, 60, 120. Now I want to extract all the lines starting from x-5 to... (3 Replies)
Hi,
I would like to seek for methods to do selective extraction of line froma file. The scenario as follows:
I have a file with content:
message a
received on 11:10:00
file size: 10 bytes
send by abc
message b
received on 11:20:00
file size: 10 bytes
send by abc (3 Replies)
Hello dear friends,
My problem as explained below seems really basic.
Fact is that I'm totally new to programming, and have only a week to produce a script ( CShell or Perl ? ) to perform this action.
While searching on the forums, I found a command that could help me, but I don't know... (2 Replies)
Hello everybody,
Another day another problem.
I have to create a script which collects data from 3 csv files.
I would like the script to check file1 which contains different values for the date entered previously. As you can see 01/12/2010 contains actions in the first field and in the... (7 Replies)
Hi Freinds,
I have a file1.txt in the following format
File1.txt
I want to get 2 files from the above file filextra.txt should have the lines which are ending with "<" and remaining lines in the filecompare.txt file.
Please help. (3 Replies)
Hi
I am writing a shell script to parse a CSV file , in which i am facing a problem to separate the columns . Could some one help me with it.
IN301330/00001 pvavan kumar limited xyz@ttccpp.com
IN302148/00002 PRECIOUS SECURITIES (P) LTD viash@yahoo.co.in
IN300239/00000 CENTRE india... (8 Replies)
Hello,
I'm attempting to extract 13 digit numbers beginning with 978 from a data file with the following command:
awk '{ for(i=1;i<=NF;i++) if($i ~ /^978/) print $i; }' datafile > outfile
This typically works. However, the new data file is an .xml file, and this command is no longer working... (6 Replies)
Discussion started by: palex
6 Replies
LEARN ABOUT DEBIAN
avc_compute_member
avc_compute_create(3) SELinux API documentation avc_compute_create(3)NAME
avc_compute_create, avc_compute_member - obtain SELinux label for new object.
SYNOPSIS
#include <selinux/selinux.h>
#include <selinux/avc.h>
int avc_compute_create(security_id_t ssid, security_id_t tsid,
security_class_t tclass, security_id_t *newsid);
int avc_compute_member(security_id_t ssid, security_id_t tsid,
security_class_t tclass, security_id_t *newsid);
DESCRIPTION
avc_compute_create is used to compute a SID to use for labeling a new object in a particular class based on a SID pair. This call is iden-
tical to security_compute_create, but does not require converting from userspace SID's to contexts and back again.
avc_compute_member is used to compute a SID to use for labeling a polyinstantiated object instance of a particular class based on a SID
pair. This call is identical to security_compute_member, but does not require converting from userspace SID's to contexts and back again.
These functions return a SID for the computed context in the memory referenced by sid.
RETURN VALUE
On success, zero is returned. On error, -1 is returned and errno is set appropriately.
ERRORS
EINVAL The tclass and/or the security contexts referenced by ssid and tsid are not recognized by the currently loaded policy.
ENOMEM An attempt to allocate memory failed.
AUTHOR
Eamon Walsh <ewalsh@tycho.nsa.gov>
SEE ALSO avc_init(3), avc_context_to_sid(3), security_compute_create(3), selinux(8)
30 Mar 2007 avc_compute_create(3)