
我正在嘗試使用 systemd 和 glibc 版本 2.17 來識別系統,然後運行特定的程式碼集。這就是我得出的結果,但出現錯誤
./testing.sh: line 4: [[UNIT: command not found
代碼:
#!/bin/sh
glib=`ldd --version | awk '/ldd/{print $NF}'`
ver=2.17
if [[`systemctl`=~-\.mount && $glib '==' $ver ]];then
echo "I have to execute certain specific stuff to glib ver 2.17"
fi