Sponsored Content
Full Discussion: Replace & sign to &amp word
Top Forums Shell Programming and Scripting Replace & sign to &amp word Post 302474351 by jlliagre on Wednesday 24th of November 2010 05:05:26 AM
Old 11-24-2010
Huh ?
Your code give that output:
Code:
Mr Smith &amp Mrs Smith
Mr Smith &aaapos Mrs Smith
Mr Smith &aa Mrs Smith
Mr Smith&aa Mrs Smith
Mr Smith &aaMrs Smith

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find & Replace string in multiple files & folders using perl

find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g' this is simple logic to find and replace in multiple files & folders Hope this helps. Thanks Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies

2. Shell Programming and Scripting

PHP read large string & split in multidimensional arrays & assign fieldnames & write into MYSQL

Hi, I hope the title does not scare people to look into this thread but it describes roughly what I'm trying to do. I need a solution in PHP. I'm a programming beginner, so it might be that the approach to solve this, might be easier to solve with an other approach of someone else, so if you... (0 Replies)
Discussion started by: lowmaster
0 Replies

3. UNIX for Dummies Questions & Answers

How to compare 2 files & get specific value & replace it in other file.

Hiiii Friends I have 2 files with huge data. I want to compare this 2 files & if they hav same set of vales in specific rows & columns i need to get that value from one file & replace it in other. For example: I have few set data of both files here: a.dat: PDE-W 2009 12 16 5 29 11.11 ... (10 Replies)
Discussion started by: reva
10 Replies

4. Shell Programming and Scripting

replace & with & xml file

Hello All I have a xml file with many sets of records like this <mytag>mydata</mytag> <tag2>data&</tag2> also same file can be like this <mytag>mydata</mytag> <tag2>data&</tag2> <tag3>data2&amp;data3</tag3> Now i can grep & and replace with &amp; for whole file but it will replace all... (4 Replies)
Discussion started by: lokaish23
4 Replies

5. Shell Programming and Scripting

Sort a the file & refine data column & row format

cat file1.txt field1 "user1": field2:"data-cde" field3:"data-pqr" field4:"data-mno" field1 "user1": field2:"data-dcb" field3:"data-mxz" field4:"data-zul" field1 "user2": field2:"data-cqz" field3:"data-xoq" field4:"data-pos" Now i need to have the date like below. i have just... (7 Replies)
Discussion started by: ckaramsetty
7 Replies

6. Shell Programming and Scripting

SSH Script is sticking, & sign not doing what I would expect

I am having an issue where I am do an SSH to about 30 servers one at a time however my script is getting hung up sometimes on the SSH. I thought the & at the end as seen below would fire it and move on but that does not seem to be working. #!/bin/s for remsys in trumpetsnail angel delphin... (3 Replies)
Discussion started by: LRoberts
3 Replies

7. Emergency UNIX and Linux Support

SSH Is hanging and the & sign does not seem to be working

I am having an issue where I am do an SSH to about 30 servers one at a time however my script is getting hung up sometimes on the SSH. I thought the & at the end as seen below would fire it and move on but that does not seem to be working. #!/bin/sh for remsys in trumpetsnail angel... (15 Replies)
Discussion started by: LRoberts
15 Replies

8. Shell Programming and Scripting

Replace dashes positions 351-357 & 024-043 with 0 & replace " " if exis with 04 at position 381-382

I need to replace dashes (i.e. -) if present from positions 351-357 with zero (i.e. 0), I also need to replace dash (i.e “-“) if present between position 024-043 with zero (i.e. 0) & I replace " " (i.e. 2 space characters) if present at position 381-382 with "04". Total length of record is 413.... (11 Replies)
Discussion started by: lancesunny
11 Replies

9. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies

10. Shell Programming and Scripting

I want replace string <enclosure>&#x22;</enclosure> with <enclosure>&#x5e;</enclosure> in xml

I have xml files with with extension .ktr in subfolders i want to replace the string <enclosure>&#x22;</enclosure> with <enclosure>&#x5e;</enclosure> i have written logic but it is not working correctly sed -i '' 's#<enclosure>&\#x22;</enclosure>#<enclosure>&\#x5e;</enclosure>#g' *.ktr ... (3 Replies)
Discussion started by: reddy12
3 Replies
LDAP_MODIFY_BATCH(3)							 1						      LDAP_MODIFY_BATCH(3)

ldap_modify_batch - Batch and execute modifications on an LDAP entry

SYNOPSIS
bool ldap_modify_batch (resource $link_identifier, string $dn, array $entry) DESCRIPTION
Modifies an existing entry in the LDAP directory. Allows detailed specification of the modifications to perform. PARAMETERS
o $link_identifier - An LDAP link identifier, returned by ldap_connect(3). o $dn - The distinguished name of an LDAP entity. o $entry - An array that specifies the modifications to make. Each entry in this array is an associative array with two or three keys: attrib maps to the name of the attribute to modify, modtype maps to the type of modification to perform, and (depending on the type of modification) values maps to an array of attribute values relevant to the modification. Possible values for modtype include: o LDAP_MODIFY_BATCH_ADD - Each value specified through values is added (as an additional value) to the attribute named by attrib. o LDAP_MODIFY_BATCH_REMOVE - Each value specified through values is removed from the attribute named by attrib. Any value of the attribute not contained in the values array will remain untouched. o LDAP_MODIFY_BATCH_REMOVE_ALL - All values are removed from the attribute named by attrib. A values entry must not be pro- vided. o LDAP_MODIFY_BATCH_REPLACE - All current values of the attribute named by attrib are replaced with the values specified through values. Note that any value for attrib must be a string, any value for values must be an array of strings, and any value for modtype must be one of the LDAP_MODIFY_BATCH_* constants listed above. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Add a telephone number to a contact <?php $dn = "cn=John Smith,ou=Wizards,dc=example,dc=com"; $modifs = [ [ "attrib" => "telephoneNumber", "modtype" => LDAP_MODIFY_BATCH_ADD, "values" => ["+1 555 555 1717"], ], ]; ldap_modify_batch($connection, $dn, $modifs); ?> Example #2 Rename a user <?php $dn = "cn=John Smith,ou=Wizards,dc=example,dc=com"; $modifs = [ [ "attrib" => "sn", "modtype" => LDAP_MODIFY_BATCH_REPLACE, "values" => ["Smith-Jones"], ], [ "attrib" => "givenName", "modtype" => LDAP_MODIFY_BATCH_REPLACE, "values" => ["Jack"], ], ]; ldap_modify_batch($connection, $dn, $modifs); ldap_rename($connection, $dn, "cn=Jack Smith-Jones", NULL, TRUE); ?> Example #3 Add two e-mail addresses to a user <?php $dn = "cn=Jack Smith-Jones,ou=Wizards,dc=example,dc=com"; $modifs = [ [ "attrib" => "mail", "modtype" => LDAP_MODIFY_BATCH_ADD, "values" => [ "jack.smith@example.com", "jack.smith-jones@example.com", ], ], ]; ldap_modify_batch($connection, $dn, $modifs); ?> Example #4 Change a user's password <?php $dn = "cn=Jack Smith-Jones,ou=Wizards,dc=example,dc=com"; $modifs = [ [ "attrib" => "userPassword", "modtype" => LDAP_MODIFY_BATCH_REMOVE, "values" => ["Tr0ub4dor&3"], ], [ "attrib" => "userPassword", "modtype" => LDAP_MODIFY_BATCH_ADD, "values" => ["correct horse battery staple"], ], ]; ldap_modify_batch($connection, $dn, $modifs); ?> Example #5 Change a user's password (Active Directory) <?php function adifyPw($pw) { return iconv("UTF-8", "UTF-16LE", '"' . $pw . '"'); } $dn = "cn=Jack Smith-Jones,ou=Wizards,dc=ad,dc=example,dc=com"; $modifs = [ [ "attrib" => "unicodePwd", "modtype" => LDAP_MODIFY_BATCH_REMOVE, "values" => [adifyPw("Tr0ub4dor&3")], ], [ "attrib" => "unicodePwd", "modtype" => LDAP_MODIFY_BATCH_ADD, "values" => [adifyPw("correct horse battery staple")], ], ]; ldap_modify_batch($connection, $dn, $modifs); PHP Documentation Group LDAP_MODIFY_BATCH(3)
All times are GMT -4. The time now is 04:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy