I am using getopts
to pass parameters to a shell script.
For example, I want to make operations on two sections in the script, that both start with the same letter. I also dont want to choose any other letter. For example I have two projects : project 1 and project2 and both of them start with the letter p.
Is there any way, that I can provide full strings such as --project1
etc. Or is there any other solution?
while getopts "project1 project2" opt;
# This ofcourse would not work. So, whats the solution?
Is there any alternative to getopts
?