Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
1 answer
90 views

When I set a DEBUG trap in Bash like this: set -o functrace trap 'echo "# $BASH_COMMAND" >&2' DEBUG Suddenly, this function stopped working: getBase() { local base="1ドル" ...
4 votes
1 answer
100 views

Subshell traps show parent traps with trap -p, but do not execute them. Is it possible to get the "do not execute them" state? when trap -p returns the parent state? Do I have to track trap ...
KamilCuk's user avatar
  • 146k
0 votes
1 answer
60 views

function set_trap_for_exception() { function _on_error() { echo "error start" exit 1 } trap '_on_error "$BASH_COMMAND" $LINENO' ERR } function is_hygon_cpu() { ...
0 votes
1 answer
66 views

I came across something funny today: #!/bin/bash trap 'echo>&2 "~ trapped on $? ~"' ERR declare -i i=0 while ((i < 10)); do printf "%d " $i ((i++)) done echo ...
0 votes
2 answers
75 views

I need to "deactivate" one trap handler temporarily and reinstate it later (to whatever it was before). What is the best way to do this?
Albert Camu's user avatar
3 votes
2 answers
130 views

I had the following snippet: #!/bin/bash set -E -T export ERR_FLAG=0 err_trap() { echo "hit err_trap - setting ERR_FLAG" ERR_FLAG=1 } return_trap() { echo "...
Albert Camu's user avatar
3 votes
2 answers
132 views

The following (with set -E): 1 #!/bin/bash 2 3 set -E 4 5 trap 'trap_err' ERR 6 7 trap_err() { 8 echo "D: $BASH_COMMAND . ${FUNCNAME[@]:1} . ...
Albert Camu's user avatar
0 votes
1 answer
187 views

I'm reading privileged ISA manual of RISC-V, and I found that they strictly separate the 'interrupt' and 'exception' and 'trap'. In my understanding, the asynchronous event from outside is 'interrupt',...
1 vote
0 answers
101 views

I am new to Zabbix and at the moment losing my mind how to setup trigger for receiving snmp traps interface up /down to work properly. both snmptraps, interface down and up, I am receiving but ...
1 vote
1 answer
484 views

I have a zsh script that rarely crashes with no errors showing in the log. Normally error messages appear. I'm working on a small test script and learning about trapping. I want to print variable ...
0 votes
0 answers
21 views

Hi i have strings i want to convert to numeric, basically to get the difference in area under the graph. (I have nothing to add but I have to because StackOverflow says so) Graph looks something like ...
Joy's user avatar
  • 11
0 votes
1 answer
342 views

From what I understand, there are software interrupts and hardware interrupts. Software interrupts include exception and trap, where a trap is called explicitly (such as in the case of systemcalls) ...
roeegg's user avatar
  • 344
0 votes
1 answer
183 views

I am learning the trap mechanism in xv6, getting confused when I enter the kernel and see some code like p->trapframe->epc = r_sepc(). I am wondering when do the kernel put this trapframe ...
Wang's user avatar
  • 13
2 votes
1 answer
438 views

Searching the web I couldn't find any example on how to use a bitmap (a raster image) as orbit trap to color a Julia set or Mandelbrot set. Here Inigo Quilez is explaining the method he uses in only ...
petem's user avatar
  • 820
1 vote
1 answer
88 views

I have a function that runs, and within this function, I've implemented a trap. However, it doesn't execute the code inside the trap. Instead, it writes an error message as expected, but it doesn't ...
Nadia Hansen's user avatar
  • 1,017

15 30 50 per page
1
2

AltStyle によって変換されたページ (->オリジナル) /