Compilers for shell scripts

后端 未结 3 490
梦毁少年i
梦毁少年i 2020-12-15 13:09

Do you know if there\'s any tool for compiling bash scripts?

It doesn\'t matter if that tool is just a translator (for example, something that converts a bash scrip

3条回答
  •  失恋的感觉
    2020-12-15 13:35

    In theory you could actually get a good performance boost.

    Think of all the

    if [ x"$MYVAR" == x"TheResult" ]; then echo "TheResult Happened" fi
    

    (note invocation of test, then echo, as well as the interpreting needed to be done.)

    which could be replaced by

    if ( !strcmp(myvar, "TheResult") ) printf("TheResult Happened");
    

    In C: no process launching, no having to do path searching. Lots of goodness.

提交回复
热议问题