Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

identify a space in record in Unix korn shell script

Status
Not open for further replies.

nitincm

Technical User
Sep 10, 2003
22
US
I hv a file with following entry.

dn: uid=isgwpsadmin1, ou=adminaccount, o=xyz, dc=com
owner: uid=da87793,ou=account,o=xyz,dc=com
dn: uid=AdminPassword,ou=AdminAccount,o=xyz,dc=com
owner: uid=RMX8232, ou=account, o=xyz,dc=com

How do I identify a space before comma or after comma in the above records.
and if speace is their then display uid=xxxxxxx has a space.
 
sed 's/ /./g' filename.txt > filename.spaces-to-periods

This command will turn all spaces into periods.
 
Try something like this:
Code:
egrep ' ,|, ' /path/to/file
In some flavor of *nix
Code:
 egrep
must be replaced with
Code:
 grep -E

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top