[root@node29 ~]# vim ./test.sh my_tip() { echo "${FUNCNAME[1]}(), line ${BASH_LINENO[0]}: $*" } show_file_list() { echo "begin" file_list=`ls ./big_files 2> /dev/null` if [ "$?" != 0 ]; then my_tip "Invalid file list!" return 1 fi echo "file_list is: ${file_list}" } show_file_list