トップ «前の日記(2009-06-14) 最新 次の日記(2009-06-16)» 編集

muneda's diary


2009-06-15 曇り [長年日記]

_1 sortの動きが変わった

追記(090616): この記事はガセネタです.環境変数を変えたから動きが変わりました.詳細はつづきを読んでください.

非互換とも言う.

元のファイルはこんな感じ.1〜10の数字の前にいろいろとゴミがついている.

% cat hoge
.10
..9
///8
*7
..6
\\5
;;;4
###3
**2
++1
0

これまでのsort.

% sort --version
sort (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.
% md5sum hoge
09aeba0432edb5e45f89d1e6699bbf2b  hoge
% sort hoge
###3
**2
*7
++1
..6
..9
.10
///8
0
;;;4
\\5
%

ゴミもsortの対象となり,#, *, ., /, 数字, ;, \の順にsortされた.

次に新しいsort(Fedora 11).

% sort --version
sort (GNU coreutils) 7.2
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.
% md5sum hoge
09aeba0432edb5e45f89d1e6699bbf2b  hoge
% sort hoge
0
++1
.10
**2
###3
;;;4
\\5
..6
*7
///8
..9
%

ゴミはsortの対象にはならず,その後ろの数字だけでsortされた.この変更は大きい.暗黙に何か記号を無視するようなオプションが追加されている?

もう 1 回,別パターン.a〜jまでで小文字大文字を交互に.

まずは古いsort.

% cat fuga
J
i
H
g
F
e
D
c
B
a
% md5sum fuga
1766b31a37750943abff7a8a99e52c94  fuga
% sort fuga
B
D
F
H
J
a
c
e
g
i

次に新しいsort.

% md5sum fuga
1766b31a37750943abff7a8a99e52c94  fuga
% sort fuga
a
B
c
D
e
F
g
H
i
J
%

大文字小文字混在になる.lsでも大文字小文字混在なのは同じ理由かな?

GNU Core Utilities Frequently Asked QuestionsによるとLC_ALL=POSIXをつけるといいらしい.

% sort --version
sort (GNU coreutils) 7.2
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.
% LC_ALL=POSIX sort fuga
B
D
F
H
J
a
c
e
g
i
%

となりこれまでどおり.うーん,はまりそう.

とりあえずlsの結果が気持ち悪すぎる.

Tags: Fedora Linux

_2 Fedora 11 + VMware Server 1.0.9

いろいろとメモ.

Fedora11 + ext4

ext4が入ったので/home以外ext4にしようとしたが,/bootはできないとインストーラ(anaconda?)に怒られる.仕方ないのでext3で.

VMware Server再インストール

いい機会だったのでVMware Serverを1.0.8から1.0.9へアップデート.が,ネットワークの設定がうまくできずに半日悩む.一旦アンインストール後,再インストールでNAT設定がうまくできた.vmware bridge protocolは不要.

Fedora Network Manager

CUIでは設定できないので捨て.

http://markmail.org/message/sbzjyyewwvhtdbro#query:networkmanager%20config%20file+page:1+mid:sbzjyyewwvhtdbro+state:results

yum + proxy

yum.conf に

proxy=http://proxy.example.com:8080

を追加し,/etc/yum.repo.dディレクトリ配下の.repoファイルで

#baseurl=

コメントアウトをはずし,国内ミラーのアドレスを入力.代わりに

mirrorlist=

をコメントアウトでOK.

Tags: Fedora Vista

過去の日記
2002|05|06|07|08|09|10|11|12|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|05|06|
トップ «前の日記(2009-06-14) 最新 次の日記(2009-06-16)» 編集