因为shell里$0就表示脚本本身,所以: 1#!/bin/bash 2# 3echo"exec : again!" 4sleep1 5execsh"$0" 6 ~ 1. 2. 3. 4. 5. 6. 7. 运行结果(每一秒打印一个exec : again!): gyz@debian:~/shelltest$./exec.sh exec : again! exec : again! exec : again! exec : again! ^C 1. 2. 3....