Here is my script.

#! /bin/bash

function first {
    while true; do
        read -p "Do you want First Process: " yn;
        case $yn in
            [Yy]* )
                echo first start
                sleep 2s
                echo first finish
                break;;
            [Nn]* ) break;;
        esac
    done
}

function second {
    while true; do
        read -p "Do you want Second Process: " yn;
        case $yn in
            [Yy]* )
                echo second start
                sleep 1s
                echo second finish
                break;;
            [Nn]* ) break;;
        esac
    done
}

export -f first && export -f second

parallel -j2 ::: first second

It just hangs.

I want to ask whether the user wants to continue with the script or not.
from within the function. If this is not the pattern then does parallel has
any option which ask do you want to continue with jobN.

For each job, or for selected jobs, I want to ask, "do you want to continue
with jobN (y/n)".

How can I do that?

*Thanks and Best Regards,Ahmad Ismail*

Reply via email to