LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   small bash command (https://www.linuxquestions.org/questions/linux-newbie-8/small-bash-command-870370/)

Bob32 03-22-2011 10:04 PM

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.

Telengard 03-22-2011 10:40 PM

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.

:study: http://www.gnu.org/software/bash/man...d-Substitution

Bob32 03-22-2011 10:45 PM

thanks

Telengard 03-23-2011 02:12 AM

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.


All times are GMT -5. The time now is 06:15 AM.