Git Product home page Git Product logo

Comments (15)

Barbaross93 avatar Barbaross93 commented on September 28, 2024

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.

eepykate avatar eepykate commented on September 28, 2024

from scr.

eepykate avatar eepykate commented on September 28, 2024

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.

Barbaross93 avatar Barbaross93 commented on September 28, 2024

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.

eepykate avatar eepykate commented on September 28, 2024

Perhaps.

How are you running scr?

from scr.

Barbaross93 avatar Barbaross93 commented on September 28, 2024

I'm seeing the error crop up within a terminal. My shell is zsh if that matters

from scr.

eepykate avatar eepykate commented on September 28, 2024

@Barbarossa93 I mean, are you running it like scr, bash scr, or something else?

I assume that scr is in $PATH?

from scr.

Barbaross93 avatar Barbaross93 commented on September 28, 2024

Oh sorry, yes, I'm simply running as scr -c -e with it in my $PATH

from scr.

eepykate avatar eepykate commented on September 28, 2024

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.

Barbaross93 avatar Barbaross93 commented on September 28, 2024

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.

eepykate avatar eepykate commented on September 28, 2024

from scr.

eepykate avatar eepykate commented on September 28, 2024

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.

eepykate avatar eepykate commented on September 28, 2024

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.

Barbaross93 avatar Barbaross93 commented on September 28, 2024

Wow, that is a bizarre bug! Looks like it works now, so thanks for figuring that out! I would never have guessed.

from scr.

eepykate avatar eepykate commented on September 28, 2024

Honestly, thanks for reporting. This was rather interesting.

from scr.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.