[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Change filename extension in Bash array
From: |
Reuti |
Subject: |
Re: Change filename extension in Bash array |
Date: |
Mon, 25 Jan 2021 10:47:03 +0100 |
> Am 25.01.2021 um 10:41 schrieb Jeffrey Walton <noloader@gmail.com>:
>
> Hi Everyone,
>
> Search is not turning up the results I am looking for. I would appreciate
> help.
>
> I have an array with filenames:
>
> odt_files=("ch1.odt" "ch2.odt" "ch3.odt" ...)
>
> I convert the ODT to a PDF using lowriter, which is a LibreOffice utility.
>
> I need to combine the PDFs using pdfunite for the final document.
>
> How do I create an array of filenames using the PDF extension given
> the ODT extension in odt_files?
>
> # What is needed here?
> pdf_files=${odt_files}
>
> Here are some things I know do not work:
>
> pdf_files=("${odt_files[@]/.odt/.pdf}")
> pdf_files=("${odt_files/.odt/.pdf}")
> pdf_files="${odt_files[@]/.odt/.pdf}"
> pdf_files="${odt_files/.odt/.pdf}"
pdf_files=(${odt_files[@]/.odt/.pdf})
-- Reuti
> Thanks in advance
>
> Jeff
>