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程序,执行外部命令。
#! /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程序,执行外部命令。