I have a directory structure like this:
├── lebenslauf
│ ├── lebenslauf.out
│ └── lebenslauf.tex
├── thirdPage
│ ├── auto
│ │ ├── test.el
│ │ └── thirdPage.el
│ ├── missfont.log
│ ├── thirdPage.aux
│ ├── thirdPage.log
│ ├── thirdPage.pdf
│ └── thirdPage.tex
└── titlePage
├── titlePage.aux
├── titlePage.fdb_latexmk
├── titlePage.fls
├── titlePage.log
├── titlePage.pdf
├── titlePage.tex
└── titlePage.tex~
I want to perform some actions on titlePage.tex
and lebenslauf.tex
. For that purpose, I want to print out the relative path of its location:
desired result:
$ ./script
lebenslauf/lebenslauf.tex
titlePage/titlePage.tex
That means, I want to have the path thirdPage/
completely ignored. Therefore, I think this question isn't helpful for my purposes. Additionally, I'm curious what causes the problem in my script, so I don't want to have a solution using e.g. find.
I have written the following script for that purpose:
#!/usr/bin/env bash
IFS=$'\n\t'
set -euo pipefail
d=( lebenslauf titlePage )
for file in "./${d[@]}"
do
if [[ $file =~ *.tex ]]
then
echo $file
fi
done
Which prints out just nothing. I fiddled with some variants of that, but nothing works. This is in my opinion the "best" result of what I achieved so far.
echo */titlePage.tex */lebenslauf.tex
? – Jeff Schaller May 12 '16 at 22:19