hi all,
I was able to do a script to gather a few files and sort them.
here it is:
#!/usr/bin/ksh
ls *mainFile* |cut -c20-21 | sort > temp
set -A line_array
i=0
file_name='temp'
while read file_line
do
line_array=${file_line}
let i=${i}+1 (5 Replies)
Hi Guys ,
Please help me I am having a requirement as below:
$ ls -i log* | head
66486532 log1
66486662 log10
66486663 log11
66486664 log12
66486665 log13
66486533 log2
66486534 log3
66486535 log4
66486584 log5
66486590 log6
This id listing the first 10 files starting with log.
... (4 Replies)
Hi to all.
I'm trying to sort this with the Unix command sort.
user1:12345678:3.5:2.5:8:1:2:3
user2:12345679:4.5:3.5:8:1:3:2
user3:12345687:5.5:2.5:6:1:3:2
user4:12345670:5.5:2.5:5:3:2:1
user5:12345671:2.5:5.5:7:2:3:1
I need to get this:
user3:12345687:5.5:2.5:6:1:3:2... (7 Replies)
Hello all -
I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Hi All,
I am trying to sort the below data using sort command.
temp.dat
H|S1-511091486889|27-Jul-2011 00:00:00
H|S1-511091486823|27-Jul-2011 00:00:00
H|S1-511091486757|27-Jul-2011 00:00:00
L|S1-511091486889|1
L|S1-511091486823|1
L|S1-511091486757|1
sort -t "|" -k2 -k1 temp.dat
My... (5 Replies)
sort --random-sort
The full command is
path=`find /testdir -maxdepth 1 -mindepth 1 -type d | ***Some sort of sort function*** | head -1`
I have a list I want to randomly sort. It works fine in ubuntu but on a 'osx lion' sort dosen't have the --random-sort option.
I don't want to... (5 Replies)
Input file:
100%ABC2 3.44E-12 USA
A2M%H02579 0E0 UK
100%ABC2 5.34E-8 UK
100%ABC2 3.25E-12 USA
A2M%H02579 5E-45 UK
Output file:
100%ABC2 3.44E-12 USA
100%ABC2 3.25E-12 USA
100%ABC2 5.34E-8 UK
A2M%H02579 0E0 UK
A2M%H02579 5E-45 UK
Code try:
sort -k1,1 -g -k2 -r input.txt... (2 Replies)
Hi Experts,
I have a filelist collected from another server , now want to sort the output using date/time stamp filed.
- Filed 6, 7,8 are showing the date/time/stamp.
Here is the input:
#----------------------------------------------------------------------
-rw------- 1 root ... (3 Replies)
Hi,
Could anyone kindly show me a link or explain the difference between
sort -n -k2 -k3 & sort -n -k2,3
Also, if I like to remove the row with repetition at both $2 and $3, Can I safely use
sort -u -k2 -k3
Example;
100 20 30
100 20 30
So, both $2 and $3 are same and I... (2 Replies)
Discussion started by: Indra2011
2 Replies
LEARN ABOUT DEBIAN
net::ldap::control::sortresult
Net::LDAP::Control::SortResult(3pm) User Contributed Perl Documentation Net::LDAP::Control::SortResult(3pm)NAME
Net::LDAP::Control::SortResult - Server Side Sort (SSS) result control object
SYNOPSIS
use Net::LDAP::Control::Sort;
use Net::LDAP::Constant qw(LDAP_CONTROL_SORTRESULT);
use Net::LDAP::Util qw(ldap_error_name);
$sort = Net::LDAP::Control::Sort->new(
order => "cn -age"
);
$mesg = $ldap->search( @args, control => [ $sort ]);
($resp) = $mesg->control( LDAP_CONTROL_SORTRESULT );
if ($resp) {
if ($resp->result) {
my $attr = $resp->attr;
print "Problem sorting, ",ldap_error_name($resp->result);
print " ($attr)" if $attr;
print "
";
}
else {
print "Results are sorted
";
}
}
else {
print "Server does not support sorting
";
}
DESCRIPTION
"Net::LDAP::Control::SortResult" is a sub-class of Net::LDAP::Control. It provides a class for manipulating the LDAP sort request control
1.2.840.113556.1.4.474 as defined in RFC-2891
A sort result control will be returned by the server in response to a search with a Server Side Sort control. If a sort result control is
not returned then the user may assume that the server does not support sorting and the results are not sorted.
CONSTRUCTOR ARGUMENTS
attr
If "result" indicates that there was a problem with sorting and that problem was due to one of the attributes specified in the sort
control. "attr" is set to the name of the attribute causing the problem.
result
This is the result code that describes if the sort operation was sucessful. If will be one of the result codes describes below.
METHODS
As with Net::LDAP::Control each constructor argument described above is also available as a method on the object which will return the
current value for the attribute if called without an argument, and set a new value for the attribute if called with an argument.
RESULT CODES
Possible results from a sort request are listed below. See Net::LDAP::Constant for a definition of each.
LDAP_SUCCESS
LDAP_OPERATIONS_ERROR
LDAP_TIMELIMIT_EXCEEDED
LDAP_STRONG_AUTH_REQUIRED
LDAP_ADMIN_LIMIT_EXCEEDED
LDAP_NO_SUCH_ATTRIBUTE
LDAP_INAPPROPRIATE_MATCHING
LDAP_INSUFFICIENT_ACCESS
LDAP_BUSY
LDAP_UNWILLING_TO_PERFORM
LDAP_OTHER
SEE ALSO
Net::LDAP, Net::LDAP::Control::Sort, Net::LDAP::Control, http://ww.ietf.org/rfc/rfc2891.txt
AUTHOR
Graham Barr <gbarr@pobox.com>
Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org>
COPYRIGHT
Copyright (c) 1999-2004 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
perl v5.14.2 2012-01-29 Net::LDAP::Control::SortResult(3pm)