Archive > Tag: Programming

HowTo: Ask questions in Bash?

I've been writing some script to configure some firewall and came up with this way of asking a question in Bash. I hope it helps as an example. Feel free to contribute your own:

#!/usr/bin/env bash

ask() {
    local query=$1

    if ( echo $query | grep -qi password ); then
        read …