Re: trap in shell programming

2011-03-07 Thread Bill Davidsen
xinyou yan wrote: > thank you ! > > As you write . It works . > I thought it was captured by shell. In fact the error in cods. > I am just a student . > Someone told me some skills are import . However , I study it and > find I can't use it right now . > That lead careless . > > May be we ne

Re: trap in shell programming

2011-03-07 Thread Cameron Simpson
On 07Mar2011 16:01, xinyou yan wrote: | thank you ! | | As you write . It works . | I thought it was captured by shell. In fact the error in cods. Tiny errors like this can be hard to see. You can find running scripts like this: sh -x your_script.sh ... will show you what commands are actua

Re: trap in shell programming

2011-03-07 Thread xinyou yan
thank you ! As you write . It works . I thought it was captured by shell. In fact the error in cods. I am just a student . Someone told me some skills are import . However , I study it and find I can't use it right now . That lead careless . May be we need to find interest in programming .

Re: trap in shell programming

2011-03-06 Thread Cameron Simpson
On 07Mar2011 10:17, xinyou yan wrote: | I want to know when i use | | trap 'rm -f /tmp/my_tmp_file_$$' INT | | why shell itself capture the single and she shellscript exit. But it doesn't! The shell captures the signal, runs the rm command, and proceeds. | Here is the code from << Beginn

trap in shell programming

2011-03-06 Thread xinyou yan
I want to know when i use trap 'rm -f /tmp/my_tmp_file_$$' INT why shell itself capture the single and she shellscript exit. Here is the code from << Beginning Programming>> #!/bin/sh trap 'rm -f /tmp/my_tmp_file_$$' INT echo creating file /tmp/my_tmp_file_$$ date > /tmp/my_tmp_file_$$