How to remove a defined character on an array variable in a do while statement in ksh

I have a korn shell code here on a while do statement which replace the string stored on an array removing double quotes characters on it but it doesn't work.

example record: appointmentDate[1] = "tree" which value should result to tree

#!/bin/ksh
# Remove " on string records
let recordCount=3
let recordNumber=1
while [ $recordNumber -le $recordCount ]
do
    echo "${appointmentDate[recordNumber]}"
    appointmentDate[recordNumber] = $(echo ${appointmentDate[recordNumber]}|sed -e 's/\"//g')
    echo "${appointmentDate[recordNumber]}"
    let recordNumber=$recordNumber+1
done

any ideas on the correct syntax? need help.

There is nothing special about a double quote to sed. Perhaps if you don't backslash escape it, it may work.

Thanks for the help. I got the solution. I only removed the space in the coding from appointmentDate[recordNumber] = $(echo ${appointmentDate[recordNumber]}|sed -e 's/\"//g') to appointmentDate[recordNumber]=$(echo ${appointmentDate[recordNumber]}|sed -e 's/\"//g') and the output was fine now :slight_smile:

Hi,
I am a new to this forum and want to create new thread.
Anybody please tell me how to post a new thread ?

thanks in advance.

just go to this link Unix Linux Community - Technical support for all Unix and Linux users

Thank you so much for your reply.