當前位置:首頁 » 操作系統 » linux字元拼接

linux字元拼接

發布時間: 2025-03-25 12:28:17

linux中用shell時奇怪的字元串拼接和時間計算問題

testt=$(date +%Y-%m-%d)
date2="14/08/12"
test=20
testtt="${test}${date2}"
time1=$(date +%s -d "$testt" )
time2=$(date +%s -d "$testtt" )
time=$(($time1-$time2))
echo $time

改成引號,去掉括弧!!

❷ Linux shell: 變數與字元串拼接出新變數到if語句

不能這樣寫 "${TN3RD_$(echo ${library} | tr '[a-z]' '[A-Z]')_SUPPORT}"
直接寫:
if [ "$library" == "zlib" ];then

echo "${library} is included"
fi

❸ linux shell 字元串拼接方法

CROSS_COMPILE=arm-openwrt-linux-muslgnueabi-

echo $CROSS_COMPILE

方法1:

    test1=$(echo $CROSS_COMPILE)gcc

    echo $test1

方法2:

    test2=${CROSS_COMPILE}gccabc

    echo $test2

熱點內容
scratch少兒編程課程 發布:2025-04-16 17:11:44 瀏覽:628
榮耀x10從哪裡設置密碼 發布:2025-04-16 17:11:43 瀏覽:357
java從入門到精通視頻 發布:2025-04-16 17:11:43 瀏覽:75
php微信介面教程 發布:2025-04-16 17:07:30 瀏覽:300
android實現陰影 發布:2025-04-16 16:50:08 瀏覽:788
粉筆直播課緩存 發布:2025-04-16 16:31:21 瀏覽:338
機頂盒都有什麼配置 發布:2025-04-16 16:24:37 瀏覽:204
編寫手游反編譯都需要學習什麼 發布:2025-04-16 16:19:36 瀏覽:801
proteus編譯文件位置 發布:2025-04-16 16:18:44 瀏覽:357
土壓縮的本質 發布:2025-04-16 16:13:21 瀏覽:583