Giter VIP home page Giter VIP logo

Comments (12)

olbat avatar olbat commented on July 19, 2024

Hi @m2acgi, you can specify the shell command to be used by execve as the 4th argument of the build.sh script.
I think that ./build.sh sample.sh 123456 sample "/bin/bash -s --" would work, can you give it a try ?

from binsh.

olbat avatar olbat commented on July 19, 2024

Any update? If not I'll close the issue.

from binsh.

m2acgi avatar m2acgi commented on July 19, 2024

@olbat
It not working with "/bin/bash -s --", working with /bin/bash -s --, but when shell script with multiple ssh command, it only execute the first one:

ssh [email protected] "echo 1"
ssh [email protected] "echo 2"
ssh [email protected] "echo 3"

Output:

1

from binsh.

olbat avatar olbat commented on July 19, 2024

Okay, I think that your issue is not really related to this script but more with the ssh command itself.

You should maybe use nohup, redirect the standard input&outputs, use the -T option or close anything that's preventing your ssh command to return ...

Did you try to run your script from bash directly? (if yes, is it hanging?)

from binsh.

m2acgi avatar m2acgi commented on July 19, 2024

It's all ok when run shell script directly.
It's all ok when bilud directly.
There're some ssh issues when bilud with /bin/bash -s --.

from binsh.

m2acgi avatar m2acgi commented on July 19, 2024

I must build with /bin/bash -s -- because some code in my script not compatible with /bin/dash, it only compatible with /bin/bash.

from binsh.

olbat avatar olbat commented on July 19, 2024

I think that it's related to the way both bash and ssh are dealing with standard input&outputs.

I tried to create a small example, got the same issue and managed to get it working using ssh -n or adding </dev/null after every ssh command.
Can you give it a try?

from binsh.

m2acgi avatar m2acgi commented on July 19, 2024

I've try the method you mentioned before. It can resolve this issue.

from binsh.

m2acgi avatar m2acgi commented on July 19, 2024

But I wanna to keep my script code clean. So fix the issue in binsh would be ok.

from binsh.

olbat avatar olbat commented on July 19, 2024

As I said it before I don't think that the issue is coming from binsh itself, or at least if it does there is nothing I think I can do about it (I want to keep the "pass the a key file from stdin" feature so the executable will continue to deal with the standard input the same way).

Anyway, if you have a good idea about where is this issue is coming from and how to fix it, feel free to open a pull request.

I'll try to find some time to reproduce on Debian this week. After that I'll close this issue if I don't get any news from you since there is a workaround to deal with it.

from binsh.

olbat avatar olbat commented on July 19, 2024

Another idea of a workaround if dash is really the issue here: you can try to change the default shell for your user using chsh.

from binsh.

m2acgi avatar m2acgi commented on July 19, 2024

Thank you. I'll try to change the shell from dash to bash.

from binsh.

Related Issues (1)

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.