LinuxQuestions.org
Help answer threads with 0 replies.
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 01-04-2006, 09:21 PM   #1
gmartin
Member
 
Registered: Mar 2003
Location: PA
Distribution: Slackware 13.37 Linux Reg # 341245
Posts: 285

Rep: Reputation: 40
Question Special characters in filenames


I have a directory full of wav files I need to convert using lame. If I try the obvious 'lame *.wav' I get an error because the filenames globbed with *.wav are full of spaces and dashes. using "*.wav" or '*.wav' both fail.

I know I've seen this before, but can't find an answer. Can you help?

Thanks
 
Old 01-05-2006, 07:50 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Try a batch rename of the files to replace spaces with underscores.

cd to the directory with the .wav files, then use this command:

for i in *.wav; do mv "$i" `echo $i | tr ' ' '_'`; done

Notice the back-ticks around the echo command.
 
Old 01-05-2006, 08:22 PM   #3
gmartin
Member
 
Registered: Mar 2003
Location: PA
Distribution: Slackware 13.37 Linux Reg # 341245
Posts: 285

Original Poster
Rep: Reputation: 40
OK you stimulated my memory. I think I did before this without renaming by using

for i in (*.wav); do lame -V0 "$i"; done

Now if I can figure out how to pick out the extension so I could pass file + extension then just filename.


Thanks for the help. Maybe I'll remember next time
 
  


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
special characters greenbox Linux - Software 9 12-23-2005 07:33 PM
Comment out special signs in filenames Lobais Linux - Software 3 09-02-2005 11:17 AM
bash and filenames with special characters CoolAJ86 Programming 2 03-09-2005 02:50 PM
sftp with filenames and weird characters Nevion Linux - Software 1 05-28-2004 05:29 AM
smbclient and filenames with special characters cloro_x Linux - Newbie 0 07-30-2001 04:15 PM

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

All times are GMT -5. The time now is 05:18 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