• Terrible frightening function defined in the intel oneapi toolkits envi

    From hongyi.zhao@gmail.com@21:1/5 to All on Thu Dec 30 14:47:43 2021
    I use lmod to generate the corresponding module files of Intel oneapi, and find the following code snippets in the result:

    werner@X10DAi-00:/opt/intel/oneapi$ sh_to_modulefile setvars.sh
    [...]
    set_shell_function("save_args"," \
    for arg in \"$@\";\
    do\
    printf \"%s\\n\" \"$arg\" | sed -e \"s/'/'\\\\\\\\''/g\" -e \"1s/^/'/\" -e \"\\$s/\\$/' \\\\\\\\/\";\
    done;\
    echo \" \"\
    ","")

    There are so many '\' in it, which dazzles me. It this a good style of shell script?

    Regards,
    HZ

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)