#!/bin/sh

#Copyright (C)  Texas Instruments Incorporated - http://www.ti.com/
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
#
# Neither the name of Texas Instruments Incorporated nor the names of
# its contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. mkdir -p tmp # 创建tmp目录
mkdir -p lock # 创建lock目录 i= for item in "$@" # 迭代传入的参数
do if [ $i -eq ]
then filename=$item # 获取文件名
fi if [ $i -eq ]
then outputfilename=$item # 获取输出文件名
fi if [ $i -gt ]
then
touch "lock/"$item # 创建lock文件,这个好象是暗个随机生成的数字字符串 fi
i=`expr $i + ` # i++ done echo "Filename:"$filename
echo "Output:"$outputfilename
# . 执行程序,程序会卡在这里?以下是run_script.php运行程序:
# $script_link = $found_app["Exec"];
# # strval(): 用于获取变量对应的字符串值
# # rand(): 返回随机整数
# $random_string = strval(rand());
# $random_string .= strval(rand());
# # addslashes(): 在指定的预定义字符前添加反斜杠
# $script_command = "./execute_command.sh \"".addslashes($script_link). "\" ".$random_string.".txt ".$lock_list;
# # 获取系统执行结果最后一行
# # system()第二个参数:如果提供的return_var参数,则外部命令执行后的
# # 返回状态将会被设置到此变量中
# $last_line = system($script_command." > /dev/null 2>/dev/null & ", $retval);
# . 对于Qt应用程序,个人觉得这里还是堵塞
eval $filename > "tmp/"$outputfilename >& #Using a more unique string to detect if the script is completed
# 这行文字重定向到tmp下的输出文件尾
echo "_?!!MATRIX_SCRIPT_COMPLETED!!?_" >> "tmp/"$outputfilename # 清一下屏,没找到这条命令
refresh_screen & i=
for item in "$@"
do if [ $i -gt ]
then
rm -f "lock/"$item # 删除lock下的文件 fi
i=`expr $i + ` # i++ done sleep
rm "tmp/"$outputfilename # 删除tmp下的文件

Texas Instruments matrix-gui-2.0 hacking -- execute_command.sh的更多相关文章

  1. Texas Instruments matrix-gui-2.0 hacking -- run_script.php

    <?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...

  2. Texas Instruments matrix-gui-2.0 hacking -- app_description.php

    <?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...

  3. Texas Instruments matrix-gui-2.0 hacking -- submenu.php

    <?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...

  4. Texas Instruments matrix-gui-2.0 hacking -- index.php

    <?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...

  5. Texas Instruments matrix-gui-2.0 hacking -- menubar.php

    <?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...

  6. Texas Instruments matrix-gui-2.0 hacking -- generate.php

    <?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...

  7. 【LeetCode每天一题】Set Matrix Zeroes(设置0矩阵)

    Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place. Exampl ...

  8. 问题:执行[root@node01 hadoop-2.6.0-cdh5.14.0]# sbin/start-dfs.sh 后,namenode未启动

    执行[root@node01 hadoop-2.6.0-cdh5.14.0]# sbin/start-dfs.sh 后,namenode未启动. 解决步骤: 查看/export/servers/had ...

  9. Linux安装Redis 6.0.5 ./install_server.sh报错

    Linux安装Redis 6.0.5 ./install_server.sh报错 linux 安装Redis6.0.5时 进行到./install_server.sh时报错, This systems ...

随机推荐

  1. 《F4+2团队项目系统设计改进》

    项目软件系统设计改进 1引言 1.1编写目的 本阶段完成系统的大致设计并明确系统的数据结构与软件结构.本概要设计说明书的目的就是进一步细化软件设计阶段得出的软件概貌,把它加工成在程序细节上非常接近与源 ...

  2. RabbitMQ入门_05_多线程消费同一队列

    A. 多线程消费同一队列 参考资料:https://www.rabbitmq.com/tutorials/tutorial-two-java.html 消费一条消息往往比产生一条消息慢很多,为了防止消 ...

  3. Codeforces 431C - k-Tree

    431C - k-Tree 思路:dp. dp[i][j][s] 如果s为1,表示第i层长度为j且至少包含一段>=d的距离的路径数 如果s为0,表示第i层长度为j且不包含一段>=d的距离的 ...

  4. angular5 ng-bootstrap和ngx-bootstrap区别

    https://angular.cn/resources ngx-bootstrap 安装: npm install ngx-bootstrap --save 再引入css <link href ...

  5. C# WPF 利用NPOI读写Excel文件

    https://blog.csdn.net/a312024054/article/details/70139172 [各种样式] https://www.cnblogs.com/xwgli/archi ...

  6. 012 - jstat命令查看jvm的GC情况 | jvm

    jstat命令可以查看堆内存各部分的使用量,以及加载类的数量. 命令的格式如下: jstat -<option> [-t] [-h<lines>] <vmid> [ ...

  7. Android Webview 和Javascript交互,实现Android和JavaScript相互调用

    在Android的开发过程中.遇到一个新需求.那就是让Java代码和Javascript代码进行交互.在IOS中实现起来很麻烦.而在Android中相对来说容易多了.Android对这种交互进行了很好 ...

  8. Dubbo项目一段时间后提供者消失

    Dubbo项目用了一段时间后发现接口不通了,错误500 打开监控中心发现提供者不见了 查看下日志文件发现报如下错 2018-08-06 15:10:18,008 [localhost-startSto ...

  9. Memory and Casinos CodeForces - 712E (概率,线段树)

    题目链接 题目大意:$n$个点, 每个点$i$有成功率$p_i$, 若成功走到$i+1$, 否则走到走到$i-1$, 多组询问, 求从$l$出发, 在$l$处不失败, 最后在$r$处胜利的概率 设$L ...

  10. Leetcode 73

    class Solution { public: void setZeroes(vector<vector<int>>& matrix) { vector<vec ...