the caturday's really big commit

This commit is contained in:
tTh
2024-09-28 20:25:02 +02:00
parent dfede4a816
commit a1c0fddd17
38 changed files with 603 additions and 265 deletions

0
code/bdd/README.md Normal file
View File

20
code/bdd/mkgdbm.pl Normal file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/perl -w
use strict;
use GDBM_File;
my $nomdb = "exemple.gdbm";
my (%DB, @champs);
my ($user, $gecos);
open(SOURCE, "< /etc/passwd") or die "source $!";
tie(%DB, "GDBM_File", $nomdb, GDBM_WRCREAT, 0666) or die "gdbm $!";
while (<SOURCE>) {
@champs = split ":", $_;
$user = $champs[0]."\0";
$gecos = $champs[4]."\0";
$DB{$user} = $gecos;
}
untie %DB;
close SOURCE;
0;