0

I have this code

printf '"%s" ' *.tex

which prints all files with .tex in the current directory.

Now I want only the file names (so without ".tex") and print them out the same way. I know there's a method to shorten the string with

printf '"%.4s" ' *.tex

but that is not what I want.

  • If you want to remove `.tex`, that's the last 4 characters, not 3. But don't you just want to remove everything after the last `.`, no matter how long it is? – Barmar Dec 31 '21 at 17:52
  • Ah yes, 4 characters, that's right. Sure, everything after the dot and including it should do the trick. But how? – Frederik B. Dec 31 '21 at 17:54

0 Answers0