[software and hardware technology originating from or otherwise pertinent to planet earth]
#!/usr/bin/perl -w # # ls2csv.pl - show a listing of the PHP file # (*.inc and *.php) # as a CSV table; no table headings included in # output; no params defined # sub create_listing($) { my $xtn = shift; my @files = `ls -ghoG *.$xtn`; foreach my $f (@files) { chomp($f); $f =~ s/^\s*[-rw]+\s+\d\s+(.+)/$1/; $f =~ s/ /\",\"/g; $f =~ s/^(.)/\"$1/; $f =~ s/(.)$/$1\"/; print "$f\n"; } } map { create_listing($_) } ("inc","php");
Labels: 0x0000, bash, code, gnu, linux, perl, script, shebang, source
2006/12 2007/01 2007/05 2007/06 2007/07 2007/08 2007/10 2008/01 2008/02 2008/03 2008/05 2008/11 2008/12 2009/01 2009/02 2009/03 2009/04 2009/05 2009/07 2009/09 2009/10 2009/11
Subscribe to Posts [Atom]