shell笔记

#!/bin/bash

set -x

date

if [ "$is_bag_link" == "1" ];then

    echo "$bag_path is link, start to copy"

    cp $bag_path "$bag_path.tmp" && mv "$bag_path.tmp" $bag_path

fi

echo "truth_json_path is: " $truth_json_path

if [ "$vehicle_type" == "special_vehicle" ]; then

    dir=$(ls -l $truth_json_path |awk '/^-/ {print $NF}')

    echo "truth files are: " $dir

    minDate=${dir[0]}

    maxDate=${dir[0]}

for i in ${dir};do

    if [[ ${minDate} > $i ]];then

         minDate=$i

    fi

    if [[ ${maxDate} < $i ]];then

         maxDate=$i

    fi

done

mindate=${minDate%%.*}

maxdate=${maxDate%%.*}

mindate=$((10#${mindate}-1000000))

maxdate=$((10#${maxdate}+1))

mindate=$(awk 'BEGIN{printf "%.4f\n",'$mindate'/1000000.0}')

maxdate=$(awk 'BEGIN{printf "%.4f\n",'$maxdate'/1000000.0}')

tmp_bag=${bag_path%/*}/tmp.bag

echo "min, max date: " $mindate, $maxdate, $tmp_bag

rosbag filter $bag_path $tmp_bag  "t.to_sec() > ${mindate} and t.to_sec() < ${maxdate}"

mv $bag_path "$bag_path.tmp"

mv $tmp_bag $bag_path

fi

docker stats --no-stream

rosbag info $bag_path

date

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值