當前位置:首頁 » 操作系統 » 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

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:593
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:887
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:580
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:765
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:683
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1012
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:254
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:112
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:803
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:712