Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Bash script to use getopts to get multiple values from user

while getopts :a:b:c: options; do
        case $options in

         a) fival=$OPTARG ;;
         b) secval=$OPTARG ;;
         c) thival=$OPTARG ;;
         ?) echo "i dont know what $OPTARG is" ;;
esac
done

echo "A = $firval"
echo "B = $secval"
echo "C = $thival"
Comment

PREVIOUS NEXT
Code Example
Shell :: osx go version not updating 
Shell :: bash merge directories 
Shell :: instalar cabal do haskell no ubuntu 
Shell :: terminal bash grep word inside files directory 
Shell :: kali rm 
Shell :: git push with topic 
Shell :: how to install broken pakage in apt 
Shell :: how to upgrade .rpm file in linux 
Shell :: how to fix a read only hard drive in linux 
Shell :: download marven ubuntu 
Shell :: powershell symlink python as python3 
Shell :: git update submodule to latest 
Shell :: create new repository 
Shell :: how to ssh linux 
Shell :: delete a remote branch in git 
Shell :: bash scripting tutorial 
Shell :: delete typeeset variable bash 
Shell :: How to build android cts? And how to add and run your test case? 
Shell :: para cambiar password en psql 
Shell :: how to use verifly in hardhat 
Shell :: cat goto line number 
Shell :: bash show function definition 
Shell :: delete file bash script with time and date 
Shell :: details of a long format in linux and unix based OS 
Shell :: ros2 build from source 
Shell :: how to delete default.save nginx 
Shell :: custom prompt in shell / bash 
Shell :: github actions for goreleaser 
Shell :: refname master is ambiguous 
Shell :: connect as super user 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =