01-22-2009
Newbie Help with Grep or Awk .. Easy one ...
I have this output:
uniquemember=uid=315kthatch,ou=people,ou=client315,dc=paisleyhosting,dc=com
and i want the output to be just this:
315kthatch
I need it to be generic tho, because I have hundreds of lines of output, and the preceding numbers are not always 315. So I would need everything that equals "uid=*"
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi again. Sorry if it seems like I'm spamming the boards a bit, but I figured I might as well ask all the questions I need answers to at once, and hopefully at least get some.
I have installed Solaris 10 on a server. The default text editors are there (vi, ex, ed, maybe others, I know emacs is... (4 Replies)
Discussion started by: EugeneG
4 Replies
2. Shell Programming and Scripting
Hi,
I really need some help with GREP searching...
I need to find all occurances of a file reference and remove two characters from the end of the reference. For example, here are a few lines showing the text:
<image file="STRAIGHT_004CR.jpg" ALT="STRAIGHT_004CR.jpg" />
<image... (8 Replies)
Discussion started by: steveglevin
8 Replies
3. Shell Programming and Scripting
I'm looking to write a script that takes a certain directory and gzips all its files that are older than 2 days. I've done some research but for the life of me, I can't even get any files gzipped. Any help would be greatly appreciated! (3 Replies)
Discussion started by: adrockrocks
3 Replies
4. UNIX for Dummies Questions & Answers
How come grep testfile1 won't find anything in testfile1 (even though the characters sd are there in great quantity), but grep '' testfile1 will find plenty?
Do the single quotes prevent the shell from interpreting the testfile1 is interpreted as: grep *test whether or not characters sd exist*... (5 Replies)
Discussion started by: doubleminus
5 Replies
5. Shell Programming and Scripting
Friends;
I have little experience with shell and I am not able to resolve this
problem:
file1:
CRA-JJ-W980-01; 2009-11-24; GigabitEthernet; 0/0
CRA-JJ-W980-01; 2009-11-24; GigabitEthernet;1/0
CRA-JJ-W980-01;2009-11-24;GigabitEthernet;3/0... (5 Replies)
Discussion started by: He2
5 Replies
6. Shell Programming and Scripting
pattern matching porblem.
I have a file with lines like this:
hdisk2 blah 03
hdisk3 blah 03
hdisk21 blat 06
hdisk23 blah 06
hdisk210 blat 06
So I want to grep for just hdisk2, but I get back as you would expect
hdisk2
dhsik21
hdisk23
hdisk210
I tried several... (1 Reply)
Discussion started by: adder2
1 Replies
7. UNIX for Dummies Questions & Answers
This seems like an easy question, but I can't find an answer already posted.
I want a command to return all of the lines in a file containing exactly a string
I tried
grep -x "372701" x.txt
but this did not return anything
I am just trying to search a file for lines which contain... (4 Replies)
Discussion started by: jgrosecl
4 Replies
8. UNIX for Dummies Questions & Answers
Two things.
1. I need to list all the jpg that start with a specific pattern and I tried using wildcards and can't get it to work. Basically:
grep "cpd*.jpg" myfile.sgm return all entries that start with cpd (wildcard) and jpg
but this does not work and I can't find another option--I'm... (4 Replies)
Discussion started by: jcor826
4 Replies
9. Shell Programming and Scripting
So, I have the following code:
cat testfile.txt | awk -F, '{ print $1" "$2" "$3" "$4" "$5 }' | read DOC ORG NAME
echo "$DOC"
echo "$ORG"
echo "$NAME"
My testfile.txt looks something like the following:
Document Type,Project Number,Org ID,Invoice Number
It will eventually be more... (14 Replies)
Discussion started by: Parrakarry
14 Replies
10. Shell Programming and Scripting
I am new to grep and Linux and am looking to see if grep can parse out a list of lines that have a difference of more than 10 seconds between the times on each line.
Example
2016-09-17 19:30:57 INFO: id: 4562079216, time: 2016-09-17 19:30:41,
2016-09-17 12:02:26 INFO: id:... (26 Replies)
Discussion started by: Markham
26 Replies
LEARN ABOUT DEBIAN
nfsidmap
nfsidmap(5) File Formats Manual nfsidmap(5)
NAME
nfsidmap - The NFS idmapper upcall program
SYNOPSIS
nfsidmap [-v] [-t timeout] key desc
nfsidmap [-v] [-c]
nfsidmap [-v] [-u|-g|-r user]
DESCRIPTION
The file /usr/sbin/nfsidmap is used by the NFS idmapper to translate user and group ids into names, and to translate user and group names
into ids. Idmapper uses request-key to perform the upcall and cache the result. /usr/sbin/nfsidmap is called by /sbin/request-key, and
will perform the translation and initialize a key with the resulting information.
nfsidmap can also used to clear the keyring of all the keys or revoke one particular key. This is useful when the id mappings have failed
to due to a lookup error resulting in all the cached uids/gids to be set to the user id nobody.
OPTIONS
-c Clear the keyring of all the keys.
-g user
Revoke the gid key of the given user.
-r user
Revoke both the uid and gid key of the given user.
-t timeout
Set the expiration timer, in seconds, on the key. The default is 600 seconds (10 mins).
-u user
Revoke the uid key of the given user.
-v Increases the verbosity of the output to syslog (can be specified multiple times).
CONFIGURING
The file /etc/request-key.conf will need to be modified so /sbin/request-key can properly direct the upcall. The following line should be
added before a call to keyctl negate:
create id_resolver * * /usr/sbin/nfsidmap -t 600 %k %d
This will direct all id_resolver requests to the program /usr/sbin/nfsidmap. The -t 600 defines how many seconds into the future the key
will expire. This is an optional parameter for /usr/sbin/nfsidmap and will default to 600 seconds when not specified.
The idmapper system uses four key descriptions:
uid: Find the UID for the given user
gid: Find the GID for the given group
user: Find the user name for the given UID
group: Find the group name for the given GID
You can choose to handle any of these individually, rather than using the generic upcall program. If you would like to use your own pro-
gram for a uid lookup then you would edit your request-key.conf so it looks similar to this:
create id_resolver uid:* * /some/other/program %k %d
create id_resolver * * /usr/sbin/nfsidmap %k %d
Notice that the new line was added above the line for the generic program. request-key will find the first matching line and run the cor-
responding program. In this case, /some/other/program will handle all uid lookups, and /usr/sbin/nfsidmap will handle gid, user, and group
lookups.
AUTHOR
Bryan Schumaker, <bjschuma@netapp.com>
1 October 2010 nfsidmap(5)