Comments (15)
well, I think I get what that variable is doing now, and with a little debugging, I'm finding that it's always null or 0 with the -c
flag. I have no idea why it would be the case.
from scr.
from scr.
Alright.
@Barbarossa93 Above the error checking line (166), can you put
pgrep -x "${0##*/}"; printf "\n$$\n"; exit
Just so I can see the output of pgrep (and the script's pid) - it should give 2 occurrences of the same number.
Also, to be clear, you're on the latest commit?
from scr.
For some reason on my setup, I only see one number. Yes, I'm on the latest commit.
I checked out phisch's giph and tried pgrep -f "bash.+${0##*/}"
instead of pgrep -x "${0##*/}"
and now I see two of the same number. Seems like an issue with process naming?
from scr.
Perhaps.
How are you running scr?
from scr.
I'm seeing the error crop up within a terminal. My shell is zsh if that matters
from scr.
@Barbarossa93 I mean, are you running it like scr
, bash scr
, or something else?
I assume that scr is in $PATH?
from scr.
Oh sorry, yes, I'm simply running as scr -c -e
with it in my $PATH
from scr.
Honestly I have no idea what the issue could be, but I'll keep thinking.
@Barbarossa93 one quick thing though, can you try installing dash
, then changing the /bin/sh symlink to use it (sudo ln -sf /bin/sh dash
), then try that line i told you to add again?
from scr.
So instead of changing the symlink, I just changed the shebang line to point to dash (I hope that's fine, let me know if you still want me to try with the symlink). It now works as expected. I thought bash was fully POSIX compliant, I guess it might not be?
Further, changing the shebang to point to zsh also works.
from scr.
from scr.
Alright, looks like bash gives $(subshells)
another PID with the same process name as the script.
> scr # bash
script's pid
28730
no subshell
28730
subshell
28730
28736
> scr # dash
script's pid
28797
no subshell
28797
subshell
28797
>
from scr.
Alright, looks like bash gives $(subshells) another PID with the same process name as the script.
... but only when using an empty trap
Changing trap '' INT
to trap ':' INT
seems to work. (:
is a nop, similar to true
)
god, that's an interesting bug.
from scr.
Wow, that is a bizarre bug! Looks like it works now, so thanks for figuring that out! I would never have guessed.
from scr.
Honestly, thanks for reporting. This was rather interesting.
from scr.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scr.