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

熱點內容
微信用什麼dns伺服器 發布:2025-03-28 08:39:17 瀏覽:491
跨腳本數據盈利 發布:2025-03-28 08:37:35 瀏覽:923
c語言兩個結構體 發布:2025-03-28 08:15:37 瀏覽:242
win10怎麼硬碟加密 發布:2025-03-28 08:01:18 瀏覽:96
安卓分享網易雲如何取消鏈接格式 發布:2025-03-28 07:59:16 瀏覽:789
妖精的尾巴在哪裡可以緩存 發布:2025-03-28 07:53:28 瀏覽:641
java圓周率 發布:2025-03-28 07:53:24 瀏覽:138
sql給表增加列 發布:2025-03-28 07:39:15 瀏覽:596
安卓性能平板哪個好 發布:2025-03-28 07:37:40 瀏覽:25
蘭德酷路澤大燈清洗版有哪些配置 發布:2025-03-28 07:32:24 瀏覽:230