summaryrefslogtreecommitdiffstats
path: root/not-maintained/ColaBBS_to_PttBBS/cnthomedir.pl
blob: 64695a211bb3f4bd0874bb6fc4604d7e1e92ee0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
# $Id$
# usage: cd ColaBBS/home; perl cnthomedir.pl
use IO::All;
`mkdir -p ~/home/$_` foreach( 'a'..'z', 'A'..'Z' );

foreach( <*> ){
    next if( !-d $_ || /\./ || /^[A-Za-z]$/ );
    $USERDATA < io("$_/USERDATA.DAT");
    ($userid) = $USERDATA =~ /^(\w+)/;
    $c = substr($userid, 0, 1);

    `mv ~/home/$c/$userid ~/tmp/; mv $_ ~/home/$c/$userid`;
    print "$_ => $userid\n";
}