hi,
i got a problem with understanding regular expressions. what i wanna do is
scanning the wtmp logfile for ips and if a specific ip is echoed id like to be a part of a text to be assigned to it.
the scanning is done with
#! /bin/bash
cat wtmp | strings | egrep -o "+\.+\.+\." | sort -u... (6 Replies)
I have a simple file test.out that contains data in the form of
key1=A|shift1
key2=B|shift2
key3=C|shift3
and so on.
I need to get it to print
A
B
C
I can do it using lookbehind assertion such as this
( ?<==)()
yet I was wondering if there is another way of mutching single... (8 Replies)
Hi
I have a question on regex
There is a line in a script like
my_file="$(echo SunMonTueWed | sed "s//_&g") "
My question what does the expression _&g do.
Obviously in this example the output is
_Sun_Mon_Tue_Wed
Another question can i use some trick to get the result like... (3 Replies)
Hi, im sure this is really simple but i cant quite figure it out. how do i test against a word at the beginning of the line but up to the point of a delimiter i.e. ":"
for example if i wanted to test against the user in the /etc/passwd file
peter:x:101:100:peters account:/var/peter:/bin/sh
... (3 Replies)
I have a basic question regarding * and . while using regex:
# echo 3 | grep ^*$
3
I think I understood why it outputs "3" here (because '*' matches zero or more of the previous character) but I don't understand the output of the following command:
# echo 3 | grep ^.$
#
I thought I... (7 Replies)
I have dates in mm/dd/yy format that I wish to convert to yy-mm-dd format.
()/()/() finds them, but when I try to replace with $3-$1-$2 both kate and kwrite treat it as a text literal. (2 Replies)
Hi,
I am trying to write a regex for myscript and need some input from experts.
here is what I must grep for
TICKET{Sapce}{Space}{hyphen}
so here is the example data
TICKET 34554, CT-12345, TICKET 12345: some text here
TICKET 2342, CT-12345, MA-12344: some text here
TICKET... (5 Replies)
Hi guys,
I have a file in the following format:
cmpr5551
cmpr6002
cmpr93
anne 5454
bbro 434
cmprsvc
cmprsvc7
ffgi55
vefe99
cmprsvc8
cmprsvc9
I need to "grep" only the entries which start with "cmpr" followed by the number. All other entries should be excluded.
I was trying to use... (3 Replies)
Hi guys,
I am trying to "grep" or "egrep" the following entry out of the file using regex:
MACCDB1 or MACCDB2
The problem is that the file might contain other entries which start with "MACCDB" string.
I was trying to use regex to "grep" the exact pattern but it fails to output the correct... (2 Replies)
I want to match all occurrence of 01,03,05,07,10,11 at 9th and 10th position of a string .
I tried the following but its also matching characters like 33 or 11 on 9th and 10th position .
sed "/^\{8\}00/d" A.TXT
000000001000
433483433339 <<< wrong
121121211100 <<< wrong
167710000110... (10 Replies)
Discussion started by: boncuk
10 Replies
LEARN ABOUT ULTRIX
getauthent
getauthuid(3x)getauthuid(3x)Name
getauthuid, getauthent, storeauthent, setauthent, setauthfile, endauthent - get/set auth entry
Syntax
#include <sys/types.h>
#include <auth.h>
AUTHORIZATION *getauthuid(uid)
uid_t uid;
AUTHORIZATION *getauthent()
int storeauthent(auth)
AUTHORIZATION *auth;
void setauthent()
void setauthfile(pathname)
char *pathname;
int endauthent()
Description
The function looks up the auth entry for the specified user ID and returns a pointer to a static area containing it.
The function retrieves the next sequential entry from the auth database and returns a pointer to a static area containing it.
The function stores the specified auth entry into the local auth database, overwriting any existing entry with the same a_uid field.
The function sets a pointer to the beginning of the auth database. This function is used with to make multiple passes through the auth
database.
The function sets the pathname of the file to be used for the local auth database in all subsequent operations.
The function closes the auth database. Subsequent calls to getauthuid, getauthent, or storeauthent reopen it.
The auth database can be distributed via the BIND/Hesiod naming service.
Restrictions
Only the superuser and members of the group authread may read information from the auth database.
Only the superuser may modify the auth database.
The auth database cannot be distributed via the Yellow Pages service.
When the auth database is served by BIND/Hesiod, a program must perform its own Kerberos initialization prior to using any of these func-
tions.
The values returned by and point to a static area which is overwritten when subsequent calls are made.
Return Values
Functions which return a pointer value return the null pointer(0) on EOF or error. Other functions return zero(0) on success and a nega-
tive value on failure.
FilesSee Alsogetpwent(3), auth(5), edauth(8)
Security Guide for Users
Security Guide for Administrators
Guide to the BIND/Hesiod Service
getauthuid(3x)