Code Monkey home page Code Monkey logo

wtfc's Introduction

WaiT For the Command (wtfc)

Build Status

Shell script capable of waiting for command execution exit status for specified timeout.

Works well with POSIX shells:

  • ash, bash, dash, ksh and zsh on Linux, OSX, Busybox as well as git-bash on Windows (see our CI env).

Shells we don't support include:

  • tcsh|csh (due to missing function definition support) and fish.

Usage

Usage: wtfc.sh [OPTION]... [COMMAND]
wtfc (WaiT For The Command) waits for the COMMAND provided as the last argument or via standard input to return within timeout with expected exit status.

Functional arguments:
  -I, --interval=SECONDS       set the check interval to SECONDS (default is 1)
  -S, --status=NUMBER          set the expected COMMAND exit status to NUMBER (default is 0)
  -T, --timeout=SECONDS        set the timeout to SECONDS (0 for no timeout, default is 1)

Logging and info arguments:
  -P, --progress               show progress (default is 0)
  -H, --help                   print this help and exit
  -Q, --quiet                  be quiet
  -V, --version                display the version of wtfc and exit.

Examples:
  ./wtfc.sh -T 1 -S 0 ls /tmp                   Waits for 1 second for 'ls /tmp' to execute with exit status 0
  echo "ls /foo/bar" | ./wtfc.sh -T 2 -S 2      Waits for 2 seconds for 'ls /foo/bar' to execute with exit status 2

Inspiration

Inspired by wait-for-it as well as wait-for-command.

wtfc's People

Contributors

typekpb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

wtfc's Issues

How to execute command with args after the test finishes

So I'm waiting for my mongo db to startup at dbip:dbport, and once done I need it to run a command to start my server. I was thinking of something like ./wtfc.sh dbip:port runmyserverscript argstomyscripthere Is this possible with this script or am I mistaken?

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.