Giter Club home page Giter Club logo

basher's Introduction

basher

simple bash program to easy run and add new bash scripts

asciicast

install

sudo mkdir /var/lib/bshr && \
sudo curl -o /var/lib/bshr/bshr https://raw.githubusercontent.com/dalibor91/basher/master/basher.sh && \
sudo chmod +x /var/lib/bshr/bshr && \
sudo ln -s /var/lib/bshr/bshr /usr/local/bin/bshr

You can easy manage and download thousands of bash scripts and use them easily

Example of use Download test shell script

root@vg# bshr -a 'https://raw.githubusercontent.com/dalibor91/basher/master/basher_test.sh'
Description:
basher test script
--2017-06-30 17:38:12--  https://raw.githubusercontent.com/dalibor91/basher/master/basher_test.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 98 [text/plain]
Saving to: `/root/.basher/scripts/2017_06_30_17_38_07.sh'

100%[====================================================================================================================================================================================================================================================================================>] 98          --.-K/s   in 0s

2017-06-30 17:38:12 (15.4 MB/s) - `/root/.basher/scripts/2017_06_30_17_38_07.sh' saved [98/98]

Enter command name to run like:
basher laskjd this is not valid
Enter command name to run like:
basher_test

To see all installed scripts run:

root@vg# bshr --list
Alias: basher_test

To see details of some specific script run

root@vg# basher --explain basher_test
Downlaoded from
https://raw.githubusercontent.com/dalibor91/basher/master/basher_test.sh
--------------------------
basher test script

To run script run

root@vg# bshr -r basher_test 123 456 6789 000
Argument 0 /root/.basher/scripts/2017_06_30_17_38_07.sh
Argument 1 123
Argument 2 456
Argument 3 6789

To remove script run

root@vg# bshr -d basher_test
Removed!

To see all options run

root@vg# bshr -h
BSHR is small script that enables you running and managing shell scripts with one command
bshr
     -a  | --add     <script>     - add script to basher, local or remote
     -e  | --edit    <alias>      - edit script that you saved by some alias
     -r  | --run     <alias>      - run script that you saved by some alias
     -d  | --delete  <alias>      - deletes script
     -H  | --host    <user@host>  - destination where to run script
     -e  | --explain <alias>      - print description message
     -l  | --list                 - list all scripts
     -h  | --help                 - this message
     -su | --switch-user <user>   - run as this user (requires su permissions)
     -env                         - load env variables from files
     --args                       - pass arguments to script
     --update                     - update basher
     --cleanup                    - clear all


Script can be added from remote url or locally. If alias and description not provided with env variables,
program expect them from stdin.

Example:
    ADD_ALIAS=test ADD_DESCRIPTION=\"some test description\" bshr -a /tmp/test.sh
    bshr -a /tmp/test.sh
    bshr -e test # edits test script
    DEFAULT_EDITOR=vim bshr -e test
    bshr -r test
    bshr -r test -H [email protected]
    bshr -r test --args 'pass to script' 'also this'
    bsht -r test -H [email protected] --args 'additional' 'arg'

basher's People

Contributors

dalibor91 avatar

Watchers

 avatar

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.