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