#!/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. dataframe使用笔记

    dates=pd.date_range(',periods=6) #创建固定频度的时间序列 df=pd.DataFrame(np.random.randn(6,4),index=dates,colum ...

  2. java数组声明和变式--record1

    ​ java声明数组方式: String[] namelist; int numlist[];//此声明为动态声明,不能指定长度,numlist[10] 静态声明的方式: int a[]={1,2,3 ...

  3. 【Jmeter】Jmeter 5.0新特性

    前言 Jmeter 5.0这次的核心改进是在许多地方改进了对 Rest 的支持,此外还有调试功能.录制功能的增强.报告的改进等. 我也是因为迁移到了Mac,准备在Mac上安装Jmeter的时候发现它已 ...

  4. indexedDB入门

    localforage localStorage局限性:存储容量限制,仅支持字符串,如果是存对象还需要将使用JSON.stringify和JSON.parse方法互相转换:读取都是同步的.大多数情况o ...

  5. C#怎样用文件读写在文件的原有基础上追加一行数据

    首先添加命名空间using System.IO;这里有两种方法,希望对你有帮助,操作文件时,一定要记得及时关闭流. 第一种方法: string path="D\1.txt";//文 ...

  6. ehcache入门基础示例

    一:目录 EhCache 简介 Hello World 示例 Spring 整合 二: 简介 1. 基本介绍 EhCache 是一个纯Java的进程内缓存框架,具有快速.精干等特点,是Hibernat ...

  7. 利用Py-Socket模块做的一个不登陆windows服务器自动实现替换或者调用自动拨号功能

    xu言: 最近,有个朋友让我帮忙“搞点事情”,然后正好在学习socket模块,这个模块666啊,基本上可以实现远程服务器cmd shell的大部分功能.好,话不多说,直接上码~ 由于很多电信运营商都会 ...

  8. python模块——hashlib模块(简单文件摘要算法实现)

    #!/usr/bin/env python # -*- coding:utf-8 -*- __author__ = "loki" # Usage: hashlib模块 import ...

  9. codeforces 497b// Tennis Game// Codeforces Round #283(Div. 1)

    题意:网球有一方赢t球算一场,先赢s场的获胜.数列arr(长度为n)记录了每场的胜利者,问可能的t和s. 首先,合法的场景必须: 1两方赢的场数不一样多. 2赢多的一方最后一场必须赢. 3最后一场必须 ...

  10. Jenkins install

    Linux CentOS 7.1 x64 Java 1.8 x64 apache-maven-3.3.9 Installation sudo wget -O /etc/yum.repos.d/jenk ...