I have a script that alters lines in files. Which was working fine, but from hence forth, files will be read-only. I've tried changing wq to wq! (as I would in VI) but this has seemingly no effect. I've also tried "zz" which also did nothing.
I appreciate any help; thank you.
debug=false
## *****Put file name in quotes******
declare -a arr=("UF19905217" "UG19905218" )
##Put date in DDMMYYYY format for the date the message was original processed.
DATE="25082015"
## now loop through the above array
for i in "${arr[@]}"
do
#if "$debug; then
echo "Fix file named: Inbound_$i.msg"
MSG="Inbound_$i.msg"
#fi
if [ ! -d "$MSG" ]; then
# Enter what you would like changed here. You can copy and paste this command for multiple changes
#DATATYPE
printf "%s\n" ',s/<DataType>EDI<\/DataType>/<DataType>830<\/DataType>/g' wq | ed -s /data1/Inbound/$DATE/$MSG
echo "Complete"
else
echo "Message not found or errored!"
fi
done