2019年2月22日 星期五

Bash Tip - Use bash to implement like C's argc and argv

Test bash script capacity

I want to show how to write the advanced bash script with shift and array.
Feature:

  • filter the arguments with '-' leading character as options
  • the following inputs are the data arguments


Tested environments: - bash 4.3.48 x86_64-pc-linux-gnu ubuntu-16.04.4 LTS