Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 12-07-2012, 10:54 AM   #1
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 469

Rep: Reputation: 31
Question How do I make this work: ls -1 ".cf_db/${basename}*.srt" 2>/dev/null

How do I make this string work:

ls -1 ".cf_db/${basename}*.srt" 2>/dev/null

The ${basename} can contain spaces and special characters but as soon as you put it in quotes the wildcard no longer works.
Old 12-07-2012, 10:57 AM   #2
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 469

Original Poster
Rep: Reputation: 31
Never fails as soon as I post the question in a forum I find my own answer shortly after:

ls -1 .cf_db/"${basename}"*.srt 2>/dev/null
Old 12-07-2012, 11:12 AM   #3
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,083

Rep: Reputation: 862Reputation: 862Reputation: 862Reputation: 862Reputation: 862Reputation: 862Reputation: 862
find mite be better.

Last edited by schneidz; 12-07-2012 at 11:26 AM.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
"bash: /dev/null: Permission denied" on Ubuntu Login... sancho Ubuntu 10 10-07-2009 11:38 PM
exec("binary > /dev/null &") sodek Linux - Newbie 7 06-22-2009 06:04 PM
What is meant by " file > /dev/null 2>&1 </dev/null " attockonian Linux - Newbie 5 06-30-2006 10:51 PM
Platform-independent "/dev/null" stream redirection? wapcaplet Programming 1 08-12-2005 10:11 PM
'Can a user be created with username as "/dev/null" in an application?' sheetal_govekar Linux - Software 1 08-25-2004 11:31 AM

All times are GMT -5. The time now is 05:56 AM.

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