Sponsored Content
Full Discussion: Search File content.
Top Forums UNIX for Dummies Questions & Answers Search File content. Post 302232411 by manosubsulo on Thursday 4th of September 2008 11:36:39 AM
Old 09-04-2008
cat File.txt
95671660:Jones:Sarah:45:sales manager
93272658:Smith:John:43:technical manager
98781987:Williams:Nick:35:computer officer
99893878:Brown:Sarah:12:electrician
95673456:Couchavid:26:chef
95437869:Anderson:Sarah:19:CEO

awk -F':' '{print $2,$3,$1,$4,$5}' File.txt | sort
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script to search content of file with timestamps in the directory

hello, i want to make a script to search the file contents in my home directory by a given date and output me the line that has the date... (10 Replies)
Discussion started by: psychobeauty
10 Replies

2. UNIX for Advanced & Expert Users

Search files with specfic extention and later search content

Hi, I would appriciate if somebody can help me figure out how to search for all the *.xml file under a specific directory and subdirectroies (/home/username) and later search of content "<start>" inside the xml file returned by search. -Lovin.V (2 Replies)
Discussion started by: lovi_v
2 Replies

3. Linux

How to search file content

Hi folks, What will be an easy and effective way searching file content? E.G I need to find a WORD or a PHRASE on a file? TIA B.R. satimis (4 Replies)
Discussion started by: satimis
4 Replies

4. Shell Programming and Scripting

Perl search and replace file content.

I am not sure if this is doable. I am trying to open and print the content of the file by replacing all instances fo perl to PERL . This is my code but it is giving me the number count instead of the actual lines with changes. open (PERLHISTORY, 'sample.txt') or die "The file sample.txt could... (3 Replies)
Discussion started by: jxh461
3 Replies

5. Shell Programming and Scripting

Search for string in filename, not file content

How can I search for a string in a filename? For example, I want to know if a filename (not the file contents) contains the string "test". (3 Replies)
Discussion started by: daflore
3 Replies

6. UNIX for Dummies Questions & Answers

Using File Browser to search file content ...

Hello, I'm using rhel6. Using File Browser Nautilus 2.28.4 I could easily locate any file I'm interested in by it name. I'd like to use this File Browser to locate the file name based on it content e.g. based on some word in the text file. It doesn't work for me that way ... My question: does... (0 Replies)
Discussion started by: susja
0 Replies

7. Shell Programming and Scripting

Need to build Shell Script to search content of a text file into a folder consist several files

Have to read one file say sourcefile containing several words and having another folder containing several files. Now read the first word of Sourcefile & search it into the folder consisting sevral files, and create another file with result. We hhave to pick the filename of the file in which... (3 Replies)
Discussion started by: mukesh.baranwal
3 Replies

8. Shell Programming and Scripting

want to search some content of the file with specific to user

I have some users in one unix system and i want to search some files with specific to user and then i want to find some content inside that file so can u help me how we can implement it? File location is as below. /pools/home_unix/cmadireddy/work/models/model/ cmadireddy is user name. now... (6 Replies)
Discussion started by: lathigara
6 Replies

9. Shell Programming and Scripting

Searching the content of one file using the search key of another file

I have two files: file 1: hello.com neo.com,japan.com,example.com news.net xyz.com, telecom.net, highlands.net, software.com example2.com earth.net, abc.gov.uk file 2: neo.com example.com abc.gov.uk file 2 are the search keys to search in file 1 if any of the search key is... (3 Replies)
Discussion started by: csim_mohan
3 Replies

10. Shell Programming and Scripting

Search the specific content from the complex file

Hi, I have a file with complex data without delimiter, have requirement to fetch the specific record based on some charcters. here is my file data ... (12 Replies)
Discussion started by: Riverstone
12 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 09:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy