help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Execute function on --exec option


From: tolugboji
Subject: Execute function on --exec option
Date: Thu, 07 Oct 2021 14:31:33 +0000

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]