site-neo/get_sd.awk

8 lines
165 B
Awk
Raw Normal View History

2023-02-11 11:22:16 -05:00
#!/usr/bin/awk
BEGIN{FS="/";x=2}
2023-02-11 13:00:31 -05:00
function none() {print "main";exit}
NF==1{none()}
2023-02-11 11:22:16 -05:00
/\.\//{x++}
2023-02-11 13:00:31 -05:00
$x~/\.(txti|html|org|md)/{none()}
{if($x=="dnd")none();print $x;exit}