shell编程---exec命令

                             exec命令

#! /bin/bash
#exec command usage

function sum()
{
    let y=$1+$2
    echo $y
    return $?
}
echo "Welcome to shell script programming..."
exec ls -l
echo "exit $0 program.."

分析:exec将退出当前shell程序,执行外部命令。

猜你喜欢

转载自blog.csdn.net/yanlaifan/article/details/114649378