11-15-2005
I´ve tried it on Solaris 9 with no problems , with a no-option sort:
root@nbu-sol-1 # cat dvds
the whatever story
a day in Someone`s life
another dvd title
Starting with Starting
root@nbu-sol-1 # cat dvds | sort
Starting with Starting
a day in Someone`s life
another dvd title
the whatever story
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i am wondering is it possible to sort a file by day of the week
for example if the file is
name oncall-date phone number
john wednsday 00000000
jane tuesday 00000000
alice monday 00000000
kevin thursday 00000000
can it be sorted... (1 Reply)
Discussion started by: melkor
1 Replies
2. UNIX for Dummies Questions & Answers
Explain the output of the command “sort -rfn file1 | more”. (0 Replies)
Discussion started by: wickbc
0 Replies
3. Shell Programming and Scripting
Hello All,
I am creating a shell script that reads a file(test.txt) with the following data,
0.0.0.0
10.10.10.0
10.10.10.1
10.10.10.10
10.10.10.2
10.10.10.3
10.10.10.4
10.10.10.5
10.10.10.6
10.10.10.7
10.10.10.8
10.10.10.9
If I use the sort, the highest value I am getting is... (1 Reply)
Discussion started by: racbern
1 Replies
4. Shell Programming and Scripting
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)
Discussion started by: daniel.gbaena
7 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
Simple question.
I have a file (assumed unsorted) - can I sort said file but ignore the first two lines of the same said file (header lines) ??
Yes/No will suffice.
If Yes - will keep searching.
Cheers,
Cam (7 Replies)
Discussion started by: Cameron
7 Replies
6. UNIX for Advanced & Expert Users
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)
Discussion started by: pankaj80
3 Replies
7. Shell Programming and Scripting
Hello Everybody :) !!!. i have question in mind, is it possible to sort a list of hexadecimal numbers using "sort" command? (9 Replies)
Discussion started by: Kesavan
9 Replies
8. Shell Programming and Scripting
I have an input like
4.3.6.66
4.3.6.67
4.3.6.70
4.3.6.25
4.3.6.15
4.3.6.54
4.3.6.44
4.3.6.34
4.3.6.24
4.3.6.14
4.3.6.53
4.3.6.43
4.3.6.49
4.3.6.33
4.3.6.52
4.3.6.19
4.3.6.58
4.3.6.42 (5 Replies)
Discussion started by: dnam9917
5 Replies
9. UNIX for Beginners Questions & Answers
Hi, I need to join these statements for efficiency, and without having to make a new directory for each batch. I'm annotating commands below.
wget -q -r -l1 URL
^^ can't use -O - here and pipe | to grep because of -r
grep -hrio "\b\+@\+\.\{2,4\}\+\b" * > first.txt
^^ Need to grep the output... (14 Replies)
Discussion started by: p1ne
14 Replies
LEARN ABOUT REDHAT
gtk::clistmodel
GtkCListModel(3) User Contributed Perl Documentation GtkCListModel(3)
NAME
Gtk::CListModel - A simple data model with Gtk::Clist views
SINOPSYS
my $model = tie @data, 'Gtk::CListModel',
titles => ["Fruit", "Price", "Quantity"];
# all data manipulation is done on @data now
push @data, ["Oranges", 5, 16];
# Create a view (a Gtk::Clist widget) to represent the data
# Include only some of the data in the view (fruit type and price)
# Also, do not include fruits that cost more than 6 price units.
my $clist = $model->create_view('main',
titles => ['Fruit', 'Price'],
filter => sub {$_[1] > 6? () : @_});
DESCRIPTION
Gtk::CListModel lets you keep your data in a perl array and easily create a numer of different views on that data using Gtk::CList widgets.
The views can show only some of the columns, or a subset of the data or even munge the data with user-defined filters.
All the data manipulations will be performed on a tied array and the changes will be propagated to the views created for that data.
To create the model use "tie":
my $model = tie @data, 'Gtk::CListModel',
titles => ["head1", "head2",...];
The "titles" attribute should be an array reference with the titles of the columns of data. They will be used also for the default titles
in the views.
You can also provide the initial data using the "data" attribute. Remember that the data elements you insert and retreive from the @data
array are array references with as many items as the columns in the model. The order is the one defined by the "titles" attribute.
Later you can manipulate the @data array with the usual perl array operators, push, splice and so on.
METHODS
create_view ($name[, %options])
Create a Gtk::Clist widget that represents the data in the model. The name can be used later to disconnect the view from the data.
Options can be one of the following:
o titles
An array reference of the titles of the columns to display in the list in the order they should appear in the view. The default is the
titles specified at the model creation.
o filter
A function that can manipulate the data just before it is inserted in the Gtk::CList. The function will receive the data and can either
make a copy and modify the data or return an empty list. In the latter case the data will not be added to the view or, if the corre-
sponding row was already present, it will be removed from the view.
o postfilter
A function that receives the view, the row and the data that was just inserted/modified in the view. By default all the data is
inserted in the views as text. This filter can be used to display pixmaps, for example or do any other kind of manipulations on the
Gtk::CList row.
remove_view ($name)
Disconnect the named view from the data. The current data displayed in the view will not be affected, but changes in the model will not
propagate to this view anymore.
map_row ($clist, $row)
Get the index in the data array cooresponding to the row displayed in the Gtk::CList widget.
AUTHOR
Molaro Paolo lupus@debian.org
perl v5.8.0 2001-06-26 GtkCListModel(3)