function processurl() { repo=$1 expand=$(echo $repo | sed 's/\(.\)/\1 /g') array1=($expand) j=0 for i in $(seq 0 $((${#array1[*]} - 1))); do b[$j]=${array1[$i]} c[$i]=${array1[$i]} if [ ${array1[$i]} == "/" ]; then b[$j]="\\" c[$i]="_" let j+=1 b[$j]="/" fi let j+=1 array1[$i]='' done reponame=$(echo ${b[*]} | tr -d ' ') filename=$(echo ${c[*]} | tr -d ' ') file6=$(grep -l $repo /etc/apt/sources.list.d/*.list) expand='' for i in $(seq 0 $((${#b[*]} + ${#c[*]}))); do b[$i]='' c[$i]='' done }