How do I edit line of a file in while loop, Code works except for what is inside the "if" statement, anyone done this before? (second question today, thank you)
#!/bin/bash
export ELMS_STORAGE="/loc1/f1.csv"
export CUSTOMER_LIST="/loc2/f2.csv"
while read -r ELMS_SIZE ELMS_NAME ELMS_ENV do while IFS=, read -r
CUSTOMER_ENV CUSTOMER_URI CUSTOMER_NAME CUSTOMER_SCHEMA_OWNER
CUSTOMER_DB_INSTANCE OTHER do
if [ "${ELMS_NAME}" = "${CUSTOMER_URI}" ]; then
#### add a new item to the f2.csv
${ELMS_STORAGE}.${ELMS_ENV}="${ELMS_ENV} ${CUSTOMER_URI}" ### doesn't work
fi
done < <(tac $CUSTOMER_LIST) done < <(tac $ELMS_STORAGE)
exit
f2.csv before edit
monkey
dog
tiger
f2.csv after edit
monkey brown
bird green
cat yellow