If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Strigs replace

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-14-07, 15:53
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
Strigs replace

Need to replace line 1 with 2 in Shell script. I tried so many option but I failed in eache and evary case

1\nuserPrincipalName.+\n)
2\nuserPrincipalName:\1uid:\1

1\nuserPrincipalName.+\n)
2\nkrbPrincipalName:\1

1\nSAMAccountName.+\n)
2\nSAMAccountName:\1sn:\1

1\nSAMAccountName.+\n)
2\norclSAMAccountName:\1

1\ngivenName.+\n)
2\ngivenName:\1displayName:\1

1\nemployeeID.+\n)
2\nemployeeID:\1employeeNumber:\1

1\nobjectClass: organizationalPerson\n
2\nobjectClass: organizationalPerson\nobjectClass: inetorgperson\n

1\nobjectClass: inetorgperson\n
2\nobjectClass: inetorgperson\nobjectClass: orcluser\n

1\nobjectClass: user\n
2\nobjectClass: orcluserV2\n

The Sarrow faces are : actuvally nospace between : and (.+

Last edited by smith43017; 08-14-07 at 16:47.
Reply With Quote
  #2 (permalink)  
Old 08-14-07, 16:24
Tyveleyn Tyveleyn is offline
Registered User
 
Join Date: Aug 2006
Location: The Netherlands
Posts: 248
What are the specifications for replacement?
Reply With Quote
  #3 (permalink)  
Old 08-14-07, 16:31
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
in line values will populate.

In a single file contains lot of userinformation like given below

ex:

dn: CN=Smith \, David,OU=DCC,OU=OTO,OU=DCS,OU=LAN Configs,DC=ca,DC=ad,DC=sdsdsdsd,DC=com
changetype: add
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
cn: smith, David l: mclean title: LAN Specialist
description: DCS/OTO/DCC/CER/IMT
physicalDeliveryOfficeName: CER
telephoneNumber: (XXX) XXX-XXXX
facsimileTelephoneNumber: (XXX) XXX-XXXX
givenName: David
sAMAccountName: 45454545
userPrincipalName: 45454545@ca.ad.sdsdsdsd.com

Last edited by smith43017; 08-14-07 at 16:40.
Reply With Quote
  #4 (permalink)  
Old 08-14-07, 18:16
Tyveleyn Tyveleyn is offline
Registered User
 
Join Date: Aug 2006
Location: The Netherlands
Posts: 248
Sorry, still don't get it... Can you give a literal example of the wanted results based on the file above?
Reply With Quote
  #5 (permalink)  
Old 08-14-07, 22:07
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
At least Can I replace that particular string 1 with 2 .

I try to use sed , but failed.

Thank you for your support.
Reply With Quote
  #6 (permalink)  
Old 08-15-07, 07:42
Tyveleyn Tyveleyn is offline
Registered User
 
Join Date: Aug 2006
Location: The Netherlands
Posts: 248
Maybe I can help you but then you must be specific in your requirements...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On