procmail
[Top] [All Lists]

Re: Problem with embedding newline in a string

2021-06-10 19:55:57
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(_at_)lists(_dot_)rwth-aachen(_dot_)de   
Procmail homepage: http://www.procmail.org/
To unsubscribe send an email to 
procmail-leave(_at_)lists(_dot_)rwth-aachen(_dot_)de
https://lists.rwth-aachen.de/postorius/lists/procmail.lists.rwth-aachen.de

____________________________________________________________
procmail mailing list -- procmail(_at_)lists(_dot_)rwth-aachen(_dot_)de   
Procmail homepage: http://www.procmail.org/
To unsubscribe send an email to 
procmail-leave(_at_)lists(_dot_)rwth-aachen(_dot_)de
https://lists.rwth-aachen.de/postorius/lists/procmail.lists.rwth-aachen.de

<Prev in Thread] Current Thread [Next in Thread>