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
  • 275,237
  • 103
  • 548
  • 598
Sam Ho
  • 1,320
  • 2
  • 12
  • 12

2 Answers2

0

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

John3136
  • 28,809
  • 4
  • 51
  • 69
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,952
  • 4
  • 66
  • 85