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