Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output of trap -l #680

Open
andychu opened this issue Mar 25, 2020 · 1 comment
Open

output of trap -l #680

andychu opened this issue Mar 25, 2020 · 1 comment

Comments

@andychu
Copy link
Contributor

andychu commented Mar 25, 2020

After fixing the location. I think the EXIT and RETURN need to be turned into associative arrays, not indexed arrays?

Thank you for the report! But EXIT and RETURN must not appear here in original ble.sh. It seems there are some problems in upstream of the code, which causes the wrong values of $index.

Ah, this is caused by the format difference of trap -l between Bash and Oil. Looking at Oil trap -l outputs, ble.sh considers EXIT to be the value of ERR and RETURN to be the value of DEBUG.

bash$ builtin trap -l
 1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL       5) SIGTRAP
 6) SIGABRT      7) SIGBUS       8) SIGFPE       9) SIGKILL     10) SIGUSR1
11) SIGSEGV     12) SIGUSR2     13) SIGPIPE     14) SIGALRM     15) SIGTERM
(snip)

osh$ builtin trap -l
   EXIT
   ERR
   RETURN
   DEBUG
 1 HUP
 2 INT
 3 QUIT
(snip)

Originally posted by @akinomyoga in #664 (comment)

@andychu
Copy link
Contributor Author

andychu commented Mar 25, 2020

@akinomyoga Thanks for tracking this down!

I would like to make sure the output of everything is parseable. I don't like bash's inconsistency though, for example set -o gives one format and shopt -o -p gives another format. I feel the trap format is similarly inconsistent.

So let's leave this issue until the rest of the issues on #653 are addressed, unless you think it's blocking something now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant