LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-01-2005, 11:33 AM   #1
Lobais
Member
 
Registered: Jan 2004
Location: Denmark
Distribution: Fedora Core 6
Posts: 224

Rep: Reputation: 30
Comment out special signs in filenames


Hi, I'm writing a very small script for converting my ogg files into mp3 (for the iPod). It goes as:
Code:
for i in `locate .ogg |grep /home/thomas/multimedia/musik`
do
   ffmpeg -i "$i" "$i.mp3"
done
but the problem is, that some of the files has ugly signs in them, like: "Rammstein - Feuer Frei!.ogg". As you can see in the script a surrond the file names with "quotes" to handle the spaces, but these signs like ! doesn't work:
Code:
$ ffmpeg -i "Rammstein - Feuer Frei!.ogg" "Rammstein - Feuer Frei!.mp3"
bash: !.ogg": event not found
So is there some small utility for outcommiting file names (bash does it when pressing tab) ? Or is there some other way to handle it?
 
Old 09-01-2005, 02:27 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Try something like:
Code:
find /home/thomas/multimedia/musik -name '*.ogg' -exec ffmpeg -i "{}" "{}.mp3" \;
 
Old 09-02-2005, 04:57 AM   #3
Lobais
Member
 
Registered: Jan 2004
Location: Denmark
Distribution: Fedora Core 6
Posts: 224

Original Poster
Rep: Reputation: 30
Nice one! I didn't know about the exec flag, thank you.
 
Old 09-02-2005, 11:17 AM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
No problem. exec is very handy. Also, for future reference, find -print0 | xargs -0 can be useful as well.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
block special and character special files s_shenbaga Linux - Newbie 4 06-23-2015 02:16 AM
bash and filenames with special characters CoolAJ86 Programming 2 03-09-2005 02:50 PM
special signs missing ungua SUSE / openSUSE 19 11-27-2004 06:01 PM
How type "~" and other special signs with linux? Xavius Linux - Newbie 5 03-27-2004 11:04 PM
smbclient and filenames with special characters cloro_x Linux - Newbie 0 07-30-2001 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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