V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  howandsen  ›  全部回复第 1 页 / 共 1 页
回复总数  2
2020-10-27 23:16:41 +08:00
回复了 Chuizi997 创建的主题 Linux shell 脚本求教
#!/bin/bash
#
# vim:ft=sh

############### Variables ###############

############### Functions ###############

############### Main Part ###############

f=$(mktemp XXXXX)

I_am_5(){
sleep 3
rm $f
}

I_am_4(){
while :
do
[ ! -f "$f" ] && return
echo counting...
sleep 1
done
}

I_am_5 &

I_am_4
https://alz.ee
十年左右
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2358 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 12:41 · PVG 20:41 · LAX 05:41 · JFK 08:41
Developed with CodeLauncher
♥ Do have faith in what you're doing.