当前位置:首页 » 操作系统 » 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

热点内容
sql给表增加列 发布:2025-03-28 07:39:15 浏览:595
安卓性能平板哪个好 发布:2025-03-28 07:37:40 浏览:24
兰德酷路泽大灯清洗版有哪些配置 发布:2025-03-28 07:32:24 浏览:229
个人电脑可以装服务器cpu吗 发布:2025-03-28 07:23:53 浏览:18
安卓如何玩王者大陆 发布:2025-03-28 07:22:57 浏览:332
梁的加密区范围 发布:2025-03-28 07:16:38 浏览:812
新华社新媒体数据库 发布:2025-03-28 07:11:36 浏览:70
周老师编程 发布:2025-03-28 07:06:25 浏览:768
电脑不能上传附件 发布:2025-03-28 06:40:44 浏览:702
编程语言环境 发布:2025-03-28 06:38:52 浏览:823