spot on, thanks. > On 01/30/2023 12:14 PM CET Todd Lewis <uto...@gmail.com> wrote: > > > This works: > > cd $PGARCH > {% raw -%} > while mapfile -t -n 20 ARCHIVE_LOGS && ((${#ARCHIVE_LOGS[@]})) > {% endraw %} > do > > Or, if you had other Jinja variables to expand in that line, you could rewrite > > ${#ARCHIVE_LOGS[@]} > > as > > ${{ '{#' }}ARCHIVE_LOGS[@]} > > > > On 1/30/23 5:45 AM, dulhaver via Ansible Project wrote: > > > > > I am using the template module for a bash script > > > > > > There is a problem with these lines > > > > cd $PGARCH > > {% raw %}while mapfile -t -n 20 ARCHIVE_LOGS && ((${#ARCHIVE_LOGS[@]})){% > > endraw %} > > do > > > > they should be like below > > > > cd $PGARCH > > while mapfile -t -n 20 ARCHIVE_LOGS && ((${#ARCHIVE_LOGS[@]})) > > do > > > > but factually the line break does not survive, hence the while loop, does > > not work > > > > cd $PGARCH > > while mapfile -t -n 20 ARCHIVE_LOGS && ((${#ARCHIVE_LOGS[@]}))do > > > > > > > > I tried the change the .j2 to > > > > cd $PGARCH > > {% raw %}while mapfile -t -n 20 ARCHIVE_LOGS && ((${#ARCHIVE_LOGS[@]})){% > > endraw %}\n > > do > > > > this prevent the line breack from disappearing but the '\n' remains in the > > target file on the remote > > > > how would I approach this? > > > > > > -- > Todd > > > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to ansible-project+unsubscr...@googlegroups.com > mailto:ansible-project+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/14708166-5f98-17ce-8112-3c0ad6ad19ab%40gmail.com > > https://groups.google.com/d/msgid/ansible-project/14708166-5f98-17ce-8112-3c0ad6ad19ab%40gmail.com?utm_medium=email&utm_source=footer. >
-- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/697821475.10739.1675086133470%40office.mailbox.org.