Answer the question
In order to leave comments, you need to log in
How to implement parsing of parameters entered in an arbitrary order?
Good day. I am writing my function in bash, but how to implement free parameter input? So that I can, for example, enter:
command --param1=1 --param2=2 --param3
command --param3=2 --param1 --param2=3
//и.т.п то есть ввод параметров в случайной последовательности
Answer the question
In order to leave comments, you need to log in
https://devhints.io/bash
Getting started options
while ; do case $1 in
-V | --version )
echo $version
exit
;;
-s | --string )
shift; string=$1
;;
-f | --flag )
flag=1
;;
esac; shift; done
if ; then shift; fi
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question