How to trap ERR when using 'set -e' in Bash

前端 未结 3 1954
刺人心
刺人心 2020-12-13 03:42

I have a simple script :

#!/bin/bash
set -e
trap \"echo BOO!\" ERR 

function func(){
    ls /root/
}

func

I would like to trap ERR if my

3条回答
提交回复
热议问题