[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Execute function on --exec option
From: |
Alex fxmbsw7 Ratchev |
Subject: |
Re: Execute function on --exec option |
Date: |
Thu, 7 Oct 2021 17:41:43 +0200 |
exec function only if --exec is given to the upper script ?
check for that and do so, .. like u checked -v and such u can otherwhere
check for --exec
. ?
On Thu, Oct 7, 2021, 17:07 tolugboji via <help-bash@gnu.org> wrote:
> I have the following code and want to be able to execute the function only
> when the option `--exec`
> is used. How can I achieve that?
>
> environ-texinfo ()
> {
>
> case $1 in
> ("-V"|"--version")
> local -r date="V01 2021 Jul 21 Wk27"
> printf "$date\n"
> return
> ;;
> ("-h"|"--help")
> printf "Set environment for texinfo.\n"
> printf "Invoke texinfo using a unix-like command terminal.\n"
> printf "Command: \`texinfo &\'"
> return
> ;;
> (*)
> printf "Invoke \`environ-texinfo -h\` for detail.\n"
> ;;
> esac
>
> export TEXINFO_PATH=/usr/local/bin
> export PATH=$PATH:$TEXINFO_PATH
> }
>
> export -f linge-environ-texinfo