Remove the First Capital Letter from Each Element

Sort by

recency

|

173 Discussions

|

  • + 0 comments

    Maybe it is simplier

    `

    readarray arr for i in (echo res | tr "\n" " " done

    `

  • + 0 comments
    array=(`cat`)
    
    new_array=( ${array[@]/[A-Z]/"."})
    
    echo ${new_array[@]}
    
  • + 0 comments
    readarray -t arr
    trans_arr="${arr[@]/#[A-Z]/.}"
    echo "${trans_arr[@]}"
    
  • + 0 comments

    readarray -t MYARR for i in "i]={MYARR[$i]} | sed 's/^[A-Z]/./') done

    echo "${MYARR[*]}"

  • + 0 comments

    My solution: #!/bin/bash

    array=()

    while read -r entrada; do array+=("$entrada") done

    echo ${array[@]/[a-zA-Z]/.}