FWIW - here is a utility some folks here use for removing the top lines of files. It's in C.
Play with it first to make sure it works for you.
To compile with either gcc or cc:
Is it possible using just korn shell script to display a variable on the screen that is constantly changing in on place on the screen, to tell it in coordinates or something? In a loop, echo will print a new line each time, can I make it a static position? Thanks (7 Replies)
Hi All,
I have a doubt.
Can we assign a regular expression for pattern searching to a variable in a script and then use that variable in place of a regular expression in sed command.I tried but got some syntax error!!Is it not possible.Because my requirement is that i have a generic script to get... (8 Replies)
Hello Experts,
I am working on a small file editing script. Since all experts here are very generous to give me the complete code, I would take up the problem in steps so that I ensure my opportunity to learn.
AIM: The script has some commented and some uncommented lines. I need to :
... (2 Replies)
Hello,
I am attempting to create a command that I can eventually put into a loop so I can edit 1file on many servers. I would like to edit the file in place with sed -i. If not I will take any suggestions on how to use a temp file. I need to remove a email address from the configuration file... (4 Replies)
Hi Gurus,
I have several log files running in real time and needs to be truncated 50% or all but has to keep the logs piling up. Any ideas?
For example: /var/adm/messages and others apps log files
Thanks in advance! (7 Replies)
hi All,
i want to add the single digit front of the line in the report file and string compare with pattern file.
patter file: pattern1.txt
pattern num
like 4
love 3
john 2
report file: report.txt
i like very much
but john is good boy
i will love u
so after execute... (9 Replies)
Hello all,
I would like to create a for loop or whatever is quick that will print the one’s place of a number for 1-N times
say for example a printed page formatting is 132 characters wide,
I would like a single line
123456789012345678901234567890... ...012
That is 132 characters long. I... (11 Replies)
I have written a script to parse data from some files on a Solaris 10 system and send the output to a CSV formatted file. The code snipped i am using to pull the data is as follows....
src_line=$(sed -n "/^search_pattern$/{=;}" $file)
for i in $src_line
do
start_line1=$(( i + 9 ))
nawk -v... (4 Replies)
Okay, so i have this problem, i have a raspberry with rasbian lite (now i have openbox running on) and i do a few script for my client. But i have a question and a problem.... i got the logs file, that file need to open automatically the browser without having to do all the steps again at the next... (1 Reply)
I'm new with sed, and i am really confused with slashes, backslashes, parentheses, I've tried reading some beginner's guide, but still trouble fixing this problem, do you have any tips where or what to read to learn more about sed? can you also help me with my problem?
Note: I was tasked to use... (4 Replies)
Discussion started by: akopocpoypoy
4 Replies
LEARN ABOUT HPUX
acpm_getsubattrs
acps_spi(3) Library Functions Manual acps_spi(3)NAME
acps_spi: acpm_getenvattrs(), acpm_getobj(), acpm_getobjattrs(), acpm_getop(), acpm_getopattrs(), acpm_getsubattrs(), acpm_getsubcreds(),
acpm_getsubid() - ACPS Service Provider Interface
SYNOPSIS
[flag]... file... [library]...
DESCRIPTION
The ACPS Service Provider Interface makes it possible to define a custom module that responds to access control requests. This module is
typically written either to enforce a custom policy, or to interface to another system that defines such a policy. By creating this module
and inserting an appropriate entry into the file, all access control requests made by applications that support the Access Control Policy
Switch will automatically be routed to the module, without modifying the applications.
The service provider (module) interface is primarily composed of a well-defined routine that each module must provide and a set of helper
routines provided by the switch to encode and decode information into the opaque handle.
The single interface provided by each module is defined as follows:
The handle contains all of the request information. The argv argument contains an array of elements, each representing an argument speci-
fied in the ACPS configuration file entry for the module (see below). The module return values match exactly the API return values with
the option of an additional value indicating that no access information is available for the given request
In order for the module to retrieve information from the handle about the access control request, the switch provides the following set of
helper routines to extract the desired information, described in
Note that these routines are very similar to the API routines except that the multi-value attributes are returned as a linked list rather
than requiring individual routines. The practical reason for this is that it allows greater flexibility in manipulating the attribute data
based on the needs of the module.
In the same way that an application can retrieve the credential requested by a module, (see acps_api(3)), the module has the following
interface to encode this information into the handle:
A module would typically use this in the event that the application did not present the required credential. It is expected that the
application will add the necessary information and repeat the call to
RETURN VALUE
The values returned by the ACPS SPI (as well as the ACPS API) are defined in acps(3).
EXAMPLES
The following example illustrates a sample policy module that enforces the policy:
"users Ron, Ren, and Bill may read or write the password object"
#include <acps_spi.h>
#include <stdio.h>
extern int acpm_checkauth(acp_handle_t h, int argc, const char **argv)
{
char *user;
char *operation;
char *object;
char *buf;
int retval;
// get the user
if((retval = acpm_getsubid(h, buf, &user)) != ACPS_SUCCESS)
return retval;
if(strcmp(buf, ACPS_ID_NAME) != 0) // type validation
return ACPS_GEN_ERROR;
// get the operation
if((retval=acpm_getop(h, buf, &operation)) != ACPS_SUCCESS)
return retval;
if(strcmp(buf, ACPS_OP_DOTHEIRARCHICAL) != 0)
return ACPS_GEN_ERROR;
// get the object
if((retval = acpm_getobj(h, buf, &object)) != ACPS_SUCCESS)
return retval;
if(strcmp(buf, ACPS_OBJ_GENERIC) != 0)
return ACPS_GEN_ERROR;
// evaluate primitives against policy
if( ( (strcmp(user, "Ron") == 0)
|| (strcmp(user, "Ren") == 0)
|| (strcmp(user, "Bill") == 0))
&&( (strcmp(operation, "read") == 0)
|| (strcmp(operation, "write") == 0))
&&(strcmp(object, "password"))) {
return ACPS_ALLOW;
}
else {
return ACPS_DENY;
}
}
SEE ALSO acps(3), acps_api(3).
acps_spi(3)