Table-Dir
Kostas Lialiambis
admin at edessa.topo.auth.gr
Sat Aug 1 02:37:16 EEST 1998
Prokeimenoy na paroysiazw ta periexomena arxeiwn mesa apo web se perpiptwsh
poy o antistoixos apache den deixnei index apo directories alla yposthrizei
server-parsed html commands (dhl. thn <!--#exec cmd="somethin" -->) eixa
kanei ena mikro programma se C poy paroysiaze ta periexomena enos directory
san table (dhl. typwne <table border> kai meta to ka8e ena arxeio to typwne
se styl <tr><td><a href=filename>filename</a> <td>mod_time <td>filesize).
Omws epeidh xrhsimopoioysa thn opendir ta arxeia den paroysiazontan
soratrismena. Kai poios na katsei na ta sortarei me qsort kai de
symmazeyetai... Epeidh h aplh ls ta kanei ola monh ths ka8isa kai ekana ena
bash-shell script poy paroysiazei ta periexomena enos dir se table (me to
filename clickable, dhl, san anchor). Xrhsimopoiw mono tr kai cut (kai oxi
thn sed poy einai mana sta transformations). Epishs, antika8istw me ? ta
kena anamesa sta fields mia kai kapws dyskolo na yparxei filename me ?
Ama kaneis brei pio syntomo tropo gia to idio apotelesma as moy grapsei
giati to parakatw prepei na einai h 27h prallagh poy ekana shmera...
echo "<center>";
echo "<table border>";
echo "<tr><td>Filename<td>ModTime<td>Size";
for i in $(ls -l|tr -s " "|cut -d " " -f 5,6,7,8,9|tr " " "?");
do
echo "<tr><td><a href=\""$(echo $i|cut -d "?" -f 5)\"">"\
$(echo $i|cut -d "?" -f 5)"\
<td>"$(echo $i|cut -d "?" -f 3) \
$(echo $i|cut -d "?" -f 2) \
$(echo $i|cut -d "?" -f 4)\
"<td align=right>"$(echo -n $i|cut -d "?" -f 1);
done;
echo "</table>";
echo "</center>"
Kor.
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at argos.hol.gr
Ta archives tis listas einai sto http://www.argos.hol.gr/lists :
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users
====================================================================
More information about the Linux-greek-users
mailing list