#!/bin/bash
if [ -z "$1" ]
then
echo "No argument supplied"
exit
fi
if [ "$1"="abc" ] ; then
abc
exit
fi
if [ "$1" = "def" ]; then
def
exit 1
fi
function abc()
{
echo "hello"
}
function def()
{
echo "hi"
}
这里 abc 是一个具有局部定义的函数。但是 Bash 给出错误“./xyz.sh: line 10: abc: command not found”。请给我任何解决方案?