Sponsored Content
Full Discussion: awk/perl one-liner assist
Top Forums Shell Programming and Scripting awk/perl one-liner assist Post 302514661 by gameboy87 on Sunday 17th of April 2011 09:10:20 AM
Old 04-17-2011
MySQL

Thank you bartus11. You rock Smilie Can you pls explain me the code or give me a reference link ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl One Liner

Hi , Can anybody explain how this perl one liner works.. It is to test whether the number is prime or not perl -le 'print "PRIME" if (1 x shift) !~ /^(11+)\1+$/' 19 Thanks in advance Shihab (2 Replies)
Discussion started by: shihabvk
2 Replies

2. Shell Programming and Scripting

Search & Replace regex Perl one liner to AWK one liner

Thanks for giving your time and effort to answer questions and helping newbies like me understand awk. I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk. Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Discussion started by: verge
9 Replies

3. Shell Programming and Scripting

Need an awk / sed / or perl one-liner to remove last 4 characters with non-unique pattern.

Hi, I'm writing a ksh script and trying to use an awk / sed / or perl one-liner to remove the last 4 characters of a line in a file if it begins with a period. Here is the contents of the file... the column in which I want to remove the last 4 characters is the last column. ($6 in awk). I've... (10 Replies)
Discussion started by: right_coaster
10 Replies

4. Shell Programming and Scripting

Replacing Awk with One-liner Perl

can someone help me translate the following command, from: /usr/bin/awk "/^$TOFDAYM $TOFDAYD /,0" $LOGFILE to something like perl -e ..... basically, i want to use perl to do awk functions within a shell script. i want to do the above awk, using perl. any suggestions? (9 Replies)
Discussion started by: SkySmart
9 Replies

5. Shell Programming and Scripting

replace awk with a perl one liner (REGEXP and FS)

hello, I want to replace awk with a perl one liner in unix. i use in awk REGEX and FS ( field separator) because awk syntaxes in different unix os versions have not the same behaviour. Awk, Nawk and GNU Awk Cheat Sheet - good coders code, great reuse i have a file named "file" and want... (5 Replies)
Discussion started by: bora99
5 Replies

6. UNIX for Dummies Questions & Answers

Perl one liner to replace text

Not quite a unix question but problem in a perl command. Taking a chance if someone knows about the error cat 1 a b c d perl -p -e 's/a/b/g' 1 b b c d What is the problem here?? perl -p -i -e 's/a/b/g' 1 Can't remove 1: Text file busy, skipping file. (2 Replies)
Discussion started by: analyst
2 Replies

7. Shell Programming and Scripting

HELP with AWK one-liner. Need to employ an If condition inside AWK to check for array variable ?

Hello experts, I'm stuck with this script for three days now. Here's what i need. I need to split a large delimited (,) file into 2 files based on the value present in the last field. Samp: Something.csv bca,adc,asdf,123,12C bca,adc,asdf,123,13C def,adc,asdf,123,12A I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies

8. Shell Programming and Scripting

Delete line - Perl one liner

Hi all, I need a Perl one liner which prints a newline into a .txt file, only where the line starts with "/mediawiki-1.19.0/". It should add the newline to the line before. My problem is, when I try to realize this (with my little knowledge :rolleyes: ) i come to the point where the // are... (4 Replies)
Discussion started by: Mr.Smith
4 Replies

9. Shell Programming and Scripting

PERL one liner

hi, I am using PERL one liner for oracle database connection as : $PERL -e "use DBI; DBI->connect(qw(DBI:Oracle:SID user passwd));" is there a way to append select statement to this connection ? i.e. DB connection and select stmt in one line ? how to do sysdba connection using one lines... (1 Reply)
Discussion started by: talashil
1 Replies

10. Shell Programming and Scripting

Perl one liner to wrap comment lines

Greetings fellow scripters. I find myself editing multiple files, sometimes with the same bits of information. My bash script, a changelog, and a plist file (OS X). Once I realized this, I thought why not script part of this process (and so it begins). In any case, I've solved several of the... (1 Reply)
Discussion started by: reid
1 Replies
LDAP_PARSE_RESULT(3)							 1						      LDAP_PARSE_RESULT(3)

ldap_parse_result - Extract information from result

SYNOPSIS
bool ldap_parse_result (resource $link, resource $result, int &$errcode, [string &$matcheddn], [string &$errmsg], [array &$refer- rals]) DESCRIPTION
Parses an LDAP search result. PARAMETERS
o $link - An LDAP link identifier, returned by ldap_connect(3). o $result_identifier - An LDAP result resource, returned by ldap_list(3) or ldap_search(3). o $errcode - A reference to a variable that will be set to the LDAP error code in the result, or 0 if no error occurred. o $matcheddn - A reference to a variable that will be set to a matched DN if one was recognised within the request, otherwise it will be set to NULL. o $errmsg - A reference to a variable that will be set to the LDAP error message in the result, or an empty string if no error occurred. o $referrals - A reference to a variable that will be set to an array set to all of the referral strings in the result, or an empty array if no referrals were returned. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 ldap_parse_result(3) example <?php $result = ldap_search($link, "cn=userref,dc=my-domain,dc=com", "(cn=user*)"); $errcode = $dn = $errmsg = $refs = null; if (ldap_parse_result($link, $result, $errcode, $dn, $errmsg, $refs)) { // do something with $errcode, $dn, $errmsg and $refs } ?> PHP Documentation Group LDAP_PARSE_RESULT(3)
All times are GMT -4. The time now is 09:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy