LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-22-2011, 11:04 PM   #1
Bob32
Member
 
Registered: Mar 2011
Posts: 97

Rep: Reputation: 0
small bash command


hello,

I need your help for a very simple bash command.
I would like to watch the last video I've downloaded without searching the folder by hand.
Here is my command:
vlc $(ls ~/Downloads/*.avi -t)
How to adapt it to files with spaces ?

I've tried several things with no success.
Thanks.
 
Old 03-22-2011, 11:40 PM   #2
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 147Reputation: 147
I think this should work for you.

Code:
vlc "$(ls ~/Downloads/*.avi -t)"
Quote:
Originally Posted by Bash Reference Manual, 3.5.4 Command Substitution
If the substitution appears within double quotes, word splitting and filename expansion are not performed on the results.
http://www.gnu.org/software/bash/man...d-Substitution
 
Old 03-22-2011, 11:45 PM   #3
Bob32
Member
 
Registered: Mar 2011
Posts: 97

Original Poster
Rep: Reputation: 0
thanks
 
Old 03-23-2011, 03:12 AM   #4
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 147Reputation: 147
You're welcome. I'm happy to know you found my post helpful.

If you feel your question has been answered then please consider using the thread tools to mark this thread solved.
 
  


Reply

Tags
bash, command substitution, filename expansion, word splitting


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Using a long Bash command including single quotes and pipes in a Bash script antcore Linux - General 9 07-22-2009 12:10 PM
small question about rm in BASH Guru Mind Programming 11 10-16-2006 04:08 PM
Bash small problem bit128_linux Programming 6 01-13-2006 01:56 AM
Very small bash script enemorales Programming 8 02-25-2005 03:47 AM
small bash script issue zoomzoom Linux - General 7 06-08-2004 07:33 PM


All times are GMT -5. The time now is 09:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration