| View previous topic :: View next topic |
| Author |
Message |
maiku Guru


Joined: 24 Mar 2004 Posts: 487 Location: Long Island, NY
|
Posted: Sun Nov 28, 2004 12:30 am Post subject: Escaping problem inside backticks? |
|
|
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 |
|
 |
adaptr Watchman


Joined: 06 Oct 2002 Posts: 6730 Location: Rotterdam, Netherlands
|
Posted: Sun Nov 28, 2004 1:02 am Post subject: |
|
|
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 |
|
 |
maiku Guru


Joined: 24 Mar 2004 Posts: 487 Location: Long Island, NY
|
Posted: Sun Nov 28, 2004 2:58 am Post subject: |
|
|
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 |
|
 |
|