Problem with embedding newline in a string

Hi, I have an issue embedding a newline in a string. For example, the following works okay: LOG=" " but the following gives an error: NL=" " giving the error: Unmatched ". My plan was to use NL as in: LOG1="$LOG1$NL some new info" or could I simply use LOG1="$LOG1 some new info" Any ideas how to solve this problem? Regards, Vlado

Hi, To correct my previous question: I realized that the issue was not in embedding a newline character but actually printing out the variable value in a TRAP call. For example, something like the following works: TRAP='echo " LOG1 $LOG1 processing end time:"' when LOG1 has a multiline string value. However, if I want to add one more command in TRAP as in: TRAP='echo " LOG1 $LOG1 processing end time:"; date' it falls appart because of the multiline 'echo' or multiline LOG1 value. Does anyone have idea how to combine two commands in TRAP and still be able to use this multiline echo? Regards, Vlado On Thu, 10 Jun 2021, Vlado Keselj wrote:
Hi,
I have an issue embedding a newline in a string.
For example, the following works okay:
LOG=" "
but the following gives an error:
NL=" "
giving the error: Unmatched ".
My plan was to use NL as in:
LOG1="$LOG1$NL some new info"
or could I simply use
LOG1="$LOG1 some new info"
Any ideas how to solve this problem?
Regards, Vlado ____________________________________________________________ procmail mailing list -- procmail@lists.rwth-aachen.de Procmail homepage: http://www.procmail.org/ To unsubscribe send an email to procmail-leave@lists.rwth-aachen.de https://lists.rwth-aachen.de/postorius/lists/procmail.lists.rwth-aachen.de
participants (1)
-
Vlado Keselj