[ Bash ] 命令进阶
开头
#!/bin/bash
实时执行命令
while :; do clear; ls -lh; sleep 1; done
中间为执行命令,后端是间隔时间
实时脚本
如下,批量启动脚本命令
for j in *; do nohup java -jar $j --spring.profiles.active=test > $j.log 2>&1 & done
打印pid
如果是使用nohup可以如下:
nohup java -jar Vertx001-1.0.0-SNAPSHOT-fat.jar & echo $! > run.pid