shell脚本增加回车符

    以nohup启动服务可以在终端关闭后保证Linux环境下的服务在后台继续运行,通常在终端执行nohup  sh   catalina.sh  run &时
需要执行一下回车键才能保证命令进行,为了保证nohup在脚本中被成功调用执行,需要在脚本中增加回车的符,否则命令执行不成功
以下是以nohup方式启动tomcat的脚本



#!/bin/bash

str=$"/n"

cd /SAPP/tomcat-admin/bin

nohup  sh   catalina.sh  run &

sstr=$(echo -e $str)

echo "$sstr

tail -20 nohup.out > /home/log/admin.log

你可能感兴趣的:(tomcat,linux,shell,脚本,终端)