0

When I perform a search with, for example:

find . -iname "U2*.mp3"

or

ls *U2

I obtain the output:

U2 With or Without You.mp3
U2 When the Streets have no name.mp3
...

If I try to play them with the command:

smplayer $(!!)

then, smplayer assumes the filenames are:

U2
With
or
Without
...

How can I deal with this, without changing the file names?

Quora Feans
  • 3,866
  • 1
    Also $(!!) doesn't do what you think it does. I recommend using the -exec functionality of find such as: find . -iname 'U2*.mp3' -exec smplayer {} \; – jesse_b Dec 28 '19 at 13:45
  • @Jesse_b: "doesn't do what you think it does"? Were you reading my thoughts? What does it does, and what do I think it does? This command works, when file names have no spaces... – Quora Feans Dec 28 '19 at 23:03

1 Answers1

2
find . -iname "U2*.mp3" -print0 | xargs -0 smplayer