shell script for generating a directory index.html file
https://megatokyo.moe/generate_dir_index.sh
=> More informations about this toot | More toots from wyatt@soc.megatokyo.moe
@wyatt aieee!
procline="$(echo "$line" | sed 's!^./!!')"
That can be done in sh. Remind me after next Tyrsday to look it over.
Meanwhile https://github.com/danvk/dygraphs/blob/master/scripts/mkdiridx.sh which gives you proper XHTML.
=> More informations about this toot | More toots from mirabilos@toot.mirbsd.org
@mirabilos haha i know my script is garbage
it's one of many scripts i wrote in a hurry using a subset of all i know because i didn't want to have to verify posix-ness.
i have many weird idioms in my scripts. would be happy to have you look it over although i might not incorporate the changes
The null separator junk in there is 100% for sure brittle as well.
=> More informations about this toot | More toots from wyatt@soc.megatokyo.moe
@wyatt what I meant is: procline=${line#./} saves you a fork+exec and at least one, if not two, more forks
=> More informations about this toot | More toots from mirabilos@toot.mirbsd.org
@wyatt also, echo is unsafe if an argument may contain a backslash (or begin with a dash)
=> More informations about this toot | More toots from mirabilos@toot.mirbsd.org
@wyatt bbl, transport
=> More informations about this toot | More toots from mirabilos@toot.mirbsd.org This content has been proxied by September (3851b).Proxy Information
text/gemini