![]() ![]() ![]() SHC uses a two-step process (Figure 1): SHC generates fairly extensive, highly specialized C source code from the shell script, which is then subsequently compiled using the C compiler to create a binary program.įigure 1: SHC steps: C code is generated, then CC compiles the code. The make test command no longer works in version 3.8.9 instead, you can use shc -f test.bash (Listing 3). After unpacking the archive, a simple make handles the compilation make install installs the program below /usr/local/. These scripts are used to make sure that SHC works properly and should therefore always be compiled before using the compiler to verify the results.Īlternatively, you could always build SHC directly from source code and then install. ( Unsupported package: Potentially dangerous ! )Īdditionally, the SHC package includes a series of test scripts ( pru.sh, test.bash) that are not installed on Arch Linux, even though the original archive contains them. If you answer y to Edit PKGBUILD?, an editor opens in which you can make the necessary changes. The correct checksum is computed by the specified tool ( sha256sums) and inserted during the install (Listing 2). The first issue relates to an incorrect checksum in the PKGBUILD file (Listing 1). You will have to navigate two obstacles during installation. On Arch Linux: The current version of the package is available from the AUR (user repositories). On Ubuntu: The PPAs for many versions and variants (Xubuntu, Mint, etc.) of this distribution have more-or-less recent versions of SHC. It is currently the most popular free tool for converting (Bash) shell scripts into executable programs (see the “Installation” section). If you have a need to protect your Bash scripts from prying eyes, though, SHC might be your best option. In fact, programs that you compile with SHC still require Bash, and speed gains are hardly noticeable. ![]() Other advantages of compiled scripts include speed and portability, but in this case, portability and faster run time are not the focus. The Shell Script Compiler tool (SHC) brings one advantage of compiled scripts to Bash: the ability to hide source code and prevent future modifications. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |