24 Jan
2005
24 Jan
'05
21:52
Randall R Schulz wrote:
I have a file that has 100 or so lines in this format:
dn: cn=SERVERNAME1,ou=NWSERVERS,ou=SERVER03,ou=iServices,ou=MON,o=LA dn:
How can I strip out everything execpt the servername? Using either shell scripting, sed or perl?
man cut
Cut is limited in its ability to delineate fields. It can use fixed character positions or a specific field separator character, but not a multi-character pattern such as "cn=".
cat testfile.txt | cut -d, -f1 | cut -d= -f2 If one call of a command doesn't do the trick, just pipe it to another.(^-^) Sandy