Texas Instruments matrix-gui-2.0 hacking -- execute_command.sh
#!/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的更多相关文章
- Texas Instruments matrix-gui-2.0 hacking -- run_script.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- Texas Instruments matrix-gui-2.0 hacking -- app_description.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- Texas Instruments matrix-gui-2.0 hacking -- submenu.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- Texas Instruments matrix-gui-2.0 hacking -- index.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- Texas Instruments matrix-gui-2.0 hacking -- menubar.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- Texas Instruments matrix-gui-2.0 hacking -- generate.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- 【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 ...
- 问题:执行[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 ...
- 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 ...
随机推荐
- Navicat+Premium+12+破解补丁
链接:https://pan.baidu.com/s/1BsEWQ__X-RQPuw2ymfxhtg 提取码:j2kb
- Centos修改系统语言
使用man page帮助时,发现居然是中文的,不过想想即便英语再水,也要逼着自己去适应.于是百度找了一下修改系统语言的方法. 首先使用 locale 命令查看当前的系统语言 然后修改时一般有两种方法, ...
- c语言中的0UL或1UL是什么意思
0UL 表示 无符号长整型 0 1UL 表示 无符号长整型 1 如果不写UL后缀,系统默认为:int, 即,有符号整数. 1.数值常数有:整型常数.浮点常数:2.只有数值常数才有后缀说明:3.数值常数 ...
- Typekit在线字库及使用方法
一.如果设计中使用了非标准的字体,你该如何去实现? 所谓的标准字体是多数机器上都会有的,或者即使没有也可以由默认字体替代的字体. 方法: 用图片代替 web fonts在线字库,如Google Web ...
- 雷林鹏分享:Ruby 类和对象
Ruby 类和对象 Ruby 是一种完美的面向对象编程语言.面向对象编程语言的特性包括: 数据封装 数据抽象 多态性 继承 这些特性将在 面向对象的 Ruby 中进行讨论. 一个面向对象的程序,涉及到 ...
- protected 与 internal
protected:在当前类的“内部” 和 派生子类的“内部” 可访问(注意:实例对象不可访问 或者说 访问不到):如果静态,则在当前类内部和派生子类内部 具有“全局效果” internal:在 ...
- Android之ToolBar和自定义ToolBar实现沉浸式状态栏
沉浸式状态栏确切的说应该叫做透明状态栏.一般情况下,状态栏的底色都为黑色,而沉浸式状态栏则是把状态栏设置为透明或者半透明. 沉浸式状态栏是从android Kitkat(Android 4.4)开始出 ...
- android--------Popupwindow的使用
PopupWindow在Android.widget包下,项目中经常会使用到PopupWindow做菜单选项, PopupWindow这个类用来实现一个弹出框,可以使用任意布局的View作为其内容, ...
- 11g adg 环境搭建实施手册-0908
11g adg 环境搭建实施手册-0908 2017年8月30日 9:16 11g adg 环境搭建实施手册-0824 2017年8月24日 10:18 ####################### ...
- EBS R12使用接口表往已存在的供应商地址下创建新的地点
在供应商 "测试供应商A" 下已经有了两个地址,分别为 "地址A","地址B",现在由于某些原因,需要在地址A下面创建新的地点. 由于业务需 ...