GithubHelp home page GithubHelp logo

Comments (3)

bdd avatar bdd commented on August 29, 2024

Looks like your instance runs on /ping request path, unlike the service instance on hc-ping.com which is available at the root.

So you should pass -api-url="https://$myserver/ping" as the argument.

from runitor.

lakemike avatar lakemike commented on August 29, 2024

Excellent! That worked. But now I encountered the next problem: When i try to put a command after "--" I had assumed it would take everything following the "--". But this does not seem to be the case because a pipe "|" character is not taken into the execution by runitor.

from runitor.

bdd avatar bdd commented on August 29, 2024

Short Answer

Piping via | is the feature of shell. Runitor will get executed only with the parameters up to the |.

If you want runitor to execute a shell for you, then you can replace the command with your shell of your choice and pass the shell command to be evaluated:

e.g.:

% runitor -api-url=https://example.com/api -- bash -c "my_cmd --flag=y foo | grep -v error:"

Long Answer

When you invoke runitor -api-url=https://example.com/api -- my_cmd --flag=y foo | grep -v error:, shell will execute runitor with args:

It will first create an anonymous pipe with two ends.

Then execute runitor, and set its argument array to:

  1. runitor
  2. -api-url=https://example.com/api
  3. --
  4. my_cmd
  5. --flag=y
  6. foo

...and then replace the stdout file descriptor of this process with one end of the pipe. Execute grep with arg array ["grep", "-v", "error:"] and connect its stdin descriptor to the other end of the pipe created above, connecting standard output (mind you, not standard error) of the left hand side invocation to the standard input of right hand side invocation.

You can see a nice illustration of how shell parses its command on explainshell.com
https://explainshell.com/explain?cmd=runitor+-api-url%3Dhttps%3A%2F%2Fexample.com%2Fapi+--+my_cmd+--flag%3Dy+foo+%7C+grep+-v+error%3A#

from runitor.

Related Issues (20)

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.