Results 1 to 6 of 6

Thread: Strigs replace

  1. #1
    Join Date
    Sep 2006
    Posts
    97

    Unanswered: 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 17:47.

  2. #2
    Join Date
    Aug 2006
    Location
    The Netherlands
    Posts
    248
    What are the specifications for replacement?

  3. #3
    Join Date
    Sep 2006
    Posts
    97
    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 17:40.

  4. #4
    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?

  5. #5
    Join Date
    Sep 2006
    Posts
    97
    At least Can I replace that particular string 1 with 2 .

    I try to use sed , but failed.

    Thank you for your support.

  6. #6
    Join Date
    Aug 2006
    Location
    The Netherlands
    Posts
    248
    Maybe I can help you but then you must be specific in your requirements...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •