Need help matching a mattern using grep/egrep in bash scripting

后端 未结 3 1337
面向向阳花
面向向阳花 2021-01-22 21:58

I am trying to match all characters of given string but those characters should match in the order as given to the bash script.

while [[ $# -gt 0 ]]; do
  case $         


        
3条回答
  •  孤街浪徒
    2021-01-22 22:14

    You may use getopts with some bash parameter substitution to construct the query string.

    #!/bin/bash
    while getopts 'i:' choice
    do
      case "${choice}" in
        i)
         length=${#OPTARG}
         for((count=0;count

    Refer this to know more on parameter substitution and this for getopts.

提交回复
热议问题