标签: exception ksh
CHECK_FTP=`cat ftp_test.txt | grep 'Login incorrect.'` if [ -n "$CHECK_FTP" ]; then " login is incorrect, please correct the password/username " cd unable_to_connect_to_remote_server
在上面的代码中,我需要引发用户定义的异常,请注意我不能使用命令exit,因为它退出脚本但不会使脚本失败。