shc,編譯 Shell Script
shc, a generic script compiler
可以把 Shell Script 原始檔編譯,以免原始碼外洩。
先從 http://www.datsi.fi.upm.es/~frosal/ 下載 shc-3.8.9.tgz。
# tar -zxvf shc-3.8.9.tgz --解壓縮
# cd shc-3.8.9
# make
make: *** No rule to make target `shc.c', needed by `shc'. Stop. --失敗,提示沒有 shc.c
# less makefile --查看 makefile 描述檔
INSTALL_PATH = /usr/local --安裝目錄,最後它會安裝在 /usr/local/bin/
shc: shc.c
$(CC) $(CFLAGS) $@.c -o $@ --需要 shc.c
# cp shc-3.8.9 .c shc.c --複製檔案
# make
# make install
安裝成功後,撰寫一個測試 Shell Script
# vi test.sh
只有兩行內容,顯示 Hello,the world
#!/bin/sh
echo "Hello, the world"
# chmod 700 test.sh
# shc -v -f test.sh
產生兩個檔案 test.sh.x.c 與 test.sh.x
# ./test.sh.x
Hello, the world
測試成功
-
在電腦版的Line輸入文字時,遇到需要換行的情形時,我都是用記事本先寫好再複製上去,這樣就可以有換行的效果,可是這樣的做法好像失去Line的便利性。 於是查了一下,原來有一個設定可以指定Enter換行,而不是發訊息出去。 完成設定之後,要發送訊息就改用Al...
-
因為春節剛過,迎來的就是元宵節,但是元宵節為什麼要猜燈謎呢? 相傳,兩千多年前,就有了猜謎這種活動。如下這首詩就是一個謎語,謎底是「猜謎」。 「一時歡樂一時愁,想起千般不對頭。 如若想得千般到,自解憂來自解愁。」 但是,猜謎又怎麼會變成燈謎呢? 據說以前一位姓胡的大地主...
-
Windows7 / Windows8 kill process Linux下要刪除某個程序通常會使用 ps 配合 kill 來刪除程序。 例如:ps -ef |grep [PROCESS NAME] kill -9 [PID] 在Windows下,通常是...