Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Escaping problem inside backticks?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
maiku
Guru
Guru


Joined: 24 Mar 2004
Posts: 487
Location: Long Island, NY

PostPosted: Sun Nov 28, 2004 12:30 am    Post subject: Escaping problem inside backticks? Reply with quote

In my images folder
Quote:
mike-gentoo-1 Images # display `ls -Q | grep -i mike | tr "\n" " "`
says
Quote:
display: unable to open image `"Azo': No such file or directory.
but
Quote:
echo `ls -Q | grep -i mike | tr "\n" " "`
says
Quote:
"Azo - Mike Portrait Final.bmp" "CaveMike.jpg" "FlashyMike.jpg" "FrankNMike.jpg" "HalfSmileMike.jpg" "HugeMike.jpg" "LaurenAndMikeBed.jpg" "LaurenWMakeupNMikeWNoMakeupToday.jpg" "Lauren_mike_grad.jpg" "LittleMike.jpg" "Mike.jpg" "MikeAcne.jpg" "MikeAcne2.jpg" "MikeAdam_NoShirts.jpg" "MikeComeLoveMe.jpg" "MikeF1.jpg" "MikeF2.jpg" "MikeF3.jpg" "MikeF4.jpg" "MikeFatFace.jpg" "MikeInBoxers.jpg" "MikeLaughs.jpg" "MikePortrait.jpg" "Mike_BeingStabbed.jpg" "Mike_FloatingHead.jpg" "Mike_NearlyDead.jpg" "Mike_Pic1.jpg" "Mike_Pic2.jpg" "Mike_SmallHair.jpg" "Mike_StabRand.jpg" "Mike_Teef.jpg" "Mike_UhYeah.jpg" "Mike_background.jpg" "MikerRoomX2.jpg" "NinjaMike.jpg" "OddFacedMike.jpg" "OttNMike.jpg" "SadMike.jpg" "SwordMike.jpg"
I've tried it with the ls option -b also, but it just says 'Azo\' is not a file. So I'm wondering, how could I possibly escape it so that display will show all of the images with my name in it no problem. 'Cause when I copy and paste the output of echo as a parameter for display... the images show fine.

This is curious! I was only testing because
Quote:
mike-gentoo-1 Images # display `ls | grep -i mike`
says
Quote:
display: unable to open image `Azo': No such file or directory.

_________________
- Mike A. Leonetti
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Sun Nov 28, 2004 1:02 am    Post subject: Reply with quote

You have to escape the results.
Use xargs or find instead - easier and less commands to run.

Code:
find ./ -iname "*mike*" exec display {};

_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
maiku
Guru
Guru


Joined: 24 Mar 2004
Posts: 487
Location: Long Island, NY

PostPosted: Sun Nov 28, 2004 2:58 am    Post subject: Reply with quote

Oh that's some good thinking, thanks.

I prefer
Quote:
ls -b | grep -i mike | xargs display
only because I can browse through them with the spacebar then.
_________________
- Mike A. Leonetti
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum