0

I want to write a bash shell script, it can accept parameters, and the parameter has prompt, example,

./test.sh --version=1.0

value 1.0 is the real parameter for my shell, and --version= is the prompt

is there any easy way to do it like this?

fedorqui
  • 252,262
  • 96
  • 511
  • 570
Sam Ho
  • 1,170
  • 1
  • 11
  • 12

2 Answers2

0

You should have have a look at man(1) getopt.

John3136
  • 28,044
  • 4
  • 47
  • 66
0

Depending what you mean by "easy" - using getopts should work. A bit of typing, but... Here are some examples to get you started:

Community
  • 1
  • 1
icyrock.com
  • 27,006
  • 4
  • 63
  • 82