将unix shell脚本转换为C ++ [英] Convert unix shell script to C++

查看:346
本文介绍了将unix shell脚本转换为C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Linux操作系统上开发基于USB树的应用程序,因为我正在将其中一个shell脚本转换为C ++。但是我在shell脚本方面没有太多经验



我在这个剧本中感到困惑



I am developing a USB tree based application on a Linux operating system for that I am converting one of the shell script to C++. But I am not that much experienced in shell script

I am confused in this script

if [ $level -gt 0 ]; then
        port=$((${devpath##*[-.]} - 1))
    else
        port=0
    fi





请在linux下的usb-devices脚本中解释一下这个脚本的含义。我如何编写C / C ++代码等同于此。我被困在这个$(($ {devpath ## * [ - 。]} - 1))剧本系列





任何帮助将不胜感激...



Any one please explain me the meaning of this script in usb-devices script in linux. How I can write a C/C++ code to equivalent of this. i am stuck in this $((${devpath##*[-.]} - 1)) line of script


Any help will be appreciated...

推荐答案

level -gt 0 ];然后
port =
level -gt 0 ]; then port=


((


{devpath ## * [ - 。]} - 1 ))
else
port = 0
fi
{devpath##*[-.]} - 1)) else port=0 fi





任何人请在linux中的usb-devices脚本中解释这个脚本的含义。我如何编写C / C ++代码等同于此。我陷入了这个



Any one please explain me the meaning of this script in usb-devices script in linux. How I can write a C/C++ code to equivalent of this. i am stuck in this


这篇关于将unix shell脚本转换为C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆