bash-preexec | ⚡ preexec and precmd functions for Bash just like Zsh | Command Line Interface library

 by   rcaloras Shell Version: 0.5.0 License: MIT

kandi X-RAY | bash-preexec Summary

kandi X-RAY | bash-preexec Summary

bash-preexec is a Shell library typically used in Utilities, Command Line Interface applications. bash-preexec has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

⚡ preexec and precmd functions for Bash just like Zsh.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              bash-preexec has a low active ecosystem.
              It has 722 star(s) with 73 fork(s). There are 32 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 13 open issues and 59 have been closed. On average issues are closed in 175 days. There are 6 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of bash-preexec is 0.5.0

            kandi-Quality Quality

              bash-preexec has 0 bugs and 0 code smells.

            kandi-Security Security

              bash-preexec has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              bash-preexec code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              bash-preexec is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              bash-preexec releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of bash-preexec
            Get all kandi verified functions for this library.

            bash-preexec Key Features

            No Key Features are available at this moment for bash-preexec.

            bash-preexec Examples and Code Snippets

            No Code Snippets are available at this moment for bash-preexec.

            Community Discussions

            QUESTION

            How to intercept/evaluate a shell command, run logic on the command and potentially kill the command
            Asked 2020-Nov-16 at 10:46

            There is a command line tool at my company that many people will use, but we need to set some restrictions on the tool's usage based on the environment that the user is in.

            For example, if the user is logged into our production environment and they run dbt run , I need to flash a warning and prompt them to continue or exit.

            I use zsh myself and found the preexec() hook, but unfortunately, because of the way this is implemented, calling exit kills the whole shell and closes the terminal. This seems to be a non-starter for this option.

            I'm looking for a pure bash alternative (many of my coworkers may not use zsh) that will allow me to evaluate a command before it's executed, run the command through some logic, and allow me to either kill the command or run it.

            Here is the zsh function i wrote for reference:

            ...

            ANSWER

            Answered 2020-Nov-16 at 10:46

            What you need to do is create a wrapper around the original command, not mess with preexec and other shell-specific hooks. Of course, you can write this wrapper itself as a zsh script. So you'll create, e.g., dbt_safe.zsh which would internally call dbt, and your colleagues would just use dbt_safe.zsh.

            Source https://stackoverflow.com/questions/64814959

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install bash-preexec

            You’ll want to pull down the file and add it to your bash profile/configuration (i.e ~/.bashrc, ~/.profile, ~/.bash_profile, etc). It must be the last thing imported in your bash profile.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/rcaloras/bash-preexec.git

          • CLI

            gh repo clone rcaloras/bash-preexec

          • sshUrl

            git@github.com:rcaloras/bash-preexec.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Command Line Interface Libraries

            ohmyzsh

            by ohmyzsh

            terminal

            by microsoft

            thefuck

            by nvbn

            fzf

            by junegunn

            hyper

            by vercel

            Try Top Libraries by rcaloras

            bashhub-client

            by rcalorasPython

            gwt-soundmanager2

            by rcalorasJavaScript

            jellopan-next

            by rcalorasTypeScript