I have 2 files each in user/admin/1/2/[a-c] subdirectories. 

The files are preQC\_1.txt and preQC\_2.txt - both of which will be inputs in my tool.

I use "${f##\*/}" for preQC\_1.txt in my for loop

```
for f in ~/1/2/*/*_1.txt; do exptool input1= "${f##*/}" input2= "{$f%_1.txt}_2.txt"

```

My program says that file '{$f%\_1.txt}\_2.txt' and I am 100% sure I am incorrectly using parameter expansion. For input2, how can I make sure I am ONLY getting the 'preQC\_2.txt' (filename+extension without the directory listing)?

EDIT: I've tried combining "${f##\*/}" and {$f%\_1.txt}\_2.txt" but that actually expands to 'user/admin/1/2/a/preQC\_1.txt\_2.txt'