diff --git a/tools/generator.sh b/tools/generator.sh index e020fe0da2..03cb00328f 100755 --- a/tools/generator.sh +++ b/tools/generator.sh @@ -15,9 +15,6 @@ # limitations under the License. echo "#define JERRY_MCU_SCRIPT \\" > $2 -cat $1 | while read line -do - line=$(echo $line | sed 's/"/\\"/g') - echo "\"$line\n\" \\" >> $2 -done +# escape all " characters, wrap each line in double quotes and end the line with '\' +sed 's/"/\\"/g' $1 | sed 's/^.*$/"\0" \\/g' >> $2 echo >> $2