LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


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

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
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 492

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
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

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

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:33 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
Open Source Consulting | Domain Registration