i didnt care about how i wrote my bash scripts, coz i know theyd ultimately be used just by myself. but for the past few day, i’ve been working on this project, mk-blog which uses some bash scripts, there are chances that others might look at them. besides in work they’re asking me maintain a server. so why not learn the standards. but i couldn’t find anything good online (i’m gonna blame my search engine lol). so…

i’d appreciate redirections to (official or community) bash coding standards

  • Zucca@sopuli.xyz
    link
    fedilink
    arrow-up
    3
    ·
    6 months ago
    • utilize awk if you need to process (=more complex than just grepping) large amounts of text.
      • make your awk code conform to at least busybox awk for compability

    I once did a sh script that needed (because I wanted a challenge?) to be compatible with vanilla Android shell too. So I needed to test it with regular bash, busybox and mksh+toybox. That was ‘fun’.

    I’ve had some initial plans to spllit the code out from that project and develop a “shell” library that would ease building shell scripts that are compatible with different systems… But I bet someone else has already done that.