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

熱點內容
原子操作linux 發布:2025-04-30 13:48:05 瀏覽:757
androidlistview選中項 發布:2025-04-30 13:21:19 瀏覽:100
置換演算法代碼 發布:2025-04-30 13:11:03 瀏覽:864
怎麼清除小米鎖屏密碼 發布:2025-04-30 13:01:23 瀏覽:77
php裝修門戶系統 發布:2025-04-30 13:01:19 瀏覽:262
配置管理包含哪些審核 發布:2025-04-30 12:57:33 瀏覽:62
3dnand存儲器 發布:2025-04-30 12:56:58 瀏覽:130
寶可夢怎麼配置單打隊伍 發布:2025-04-30 12:49:11 瀏覽:99
android刷廣告 發布:2025-04-30 12:45:40 瀏覽:230
wpf編程指南 發布:2025-04-30 12:44:00 瀏覽:160