从Shell脚本启动进程后,在Shell脚本中执行下一行 [英] Execute the next line in shell script after starting a process from shell script

查看:507
本文介绍了从Shell脚本启动进程后,在Shell脚本中执行下一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在尝试将一个Mono应用程序作为服务运行.当我从航站楼开始
使用以下方法
服务MyTestApp启动

它是服务性的,我可以查看其日志处理等并打印
启动MyTestApp

并等待终端中未显示Started MyTestApp的应用程序,并且只有在按Ctrl + C时才能键入next命令.我该如何解决

在shell脚本中启动mono应用程序后如何执行下一行.

我的示例脚本在下面给出


Hello,

I am trying to run one mono application as service. When I start from terminal
using the following method
service MyTestApp start

It strts as servive I can view its log porcess etc and prints
Starting MyTestApp

and wait the app in terminal not showing Started MyTestApp and I can possible to type next command only when I press Ctrl+C. How I can solve this

how to execute the next line after starting mono application in shell script.

my sample script is given below


#!/bin/sh
#/etc/init.d/MyTestApp


APP_NAME="MyTestApp"

case "$1" in
  start)


        echo "Starting $APP_NAME"
	mono MyTestApp.exe
 	echo "Started $APP_NAME"
       
    ;;
  stop)

       
    ;;
  *)
    echo "Usage: /etc/init.d/$APP_NAME {start|stop}"
    exit 1
    ;;
esac

exit 0 

推荐答案

1 开始) 回声开始
1" in start) echo "Starting


APP_NAME" 单声道MyTestApp.exe 回声开始
APP_NAME" mono MyTestApp.exe echo "Started


APP_NAME" ;; 停止) ;; *) echo用法:/etc/init.d/
APP_NAME" ;; stop) ;; *) echo "Usage: /etc/init.d/


这篇关于从Shell脚本启动进程后,在Shell脚本中执行下一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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