bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bizarre trap behavior while reading a file


From: tytus64
Subject: Re: bizarre trap behavior while reading a file
Date: Mon, 28 Mar 2011 09:03:07 -0700 (PDT)


Chet Ramey wrote:
> 
> 
> Sure.  Trap it to SIG_IGN: `trap "" SIGHUP'.
> 
> 

OK. Thanks everybody for their input. Really appreciate all the answers. I
modified the first loop as follows to get the subshell to ignore HUP signal:


trap "" HUP; cat $log_file | {
    while read line
    do
        line_num=`expr $line_num + 1`
        echo $line_num: $line >> ./out.log
    done
}


-- 
View this message in context: 
http://old.nabble.com/bizarre-trap-behavior-while-reading-a-file-tp31242064p31259743.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]