Pass arguments to shell function by reference
12:01 06 Apr 2015

I have a function to which Iam trying to send the array elements-

for (( idx=5 ; idx < ${#arr[*]} ; idx++ )); do
            escape_html ${arr[idx]} 
    done
function escape_html() {
x=$1
out="${x/>/%gt;}"
out="${x/

I want the value of the array element to be changed if they have > or < after the function call (just as we use in call by reference). In this code, Iam passing the value to another variable. Idont want to do that. I want to do such operations directly on my argument and want those changes to be reflected the next time I try to access those array elements

bash shell reference