You are not logged in.

#1 2012-07-28 19:17:50

shimage
Member
Registered: 2008-11-25
Posts: 17

removing double quotes from filenames

I'm trying to use zmv to remove double quotes from a bunch of filenames, but I can't seem to figure it out and my google-fu isn't good enough either. Mostly what I've been trying are variations on

zmv -n '(**/)*"*' '$1${2//"/}'

but I keep getting a syntax error in the second half (first half seems to be working fine). Thanks for any help you might have.

Offline

#2 2012-07-28 20:23:11

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,326

Re: removing double quotes from filenames

Moderator: Moving to Programming and Scripting


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#3 2012-07-28 20:49:45

FitzJac
Member
From: The Netherlands
Registered: 2011-04-07
Posts: 234

Re: removing double quotes from filenames

Something like this:

for file in *\"; do mv "$file" "`echo "$file" | sed -e 's/"//g'`"; done

Last edited by FitzJac (2012-07-28 21:02:18)


I'd rather try touching the moon
than take on a whore's thinking.
             Al Swearengen

Offline

#4 2012-07-28 21:44:22

shimage
Member
Registered: 2008-11-25
Posts: 17

Re: removing double quotes from filenames

So it turns out I'm retarded. I don't know what I was thinking sorry.

Offline

#5 2012-08-03 22:57:45

ehmicky
Member
Registered: 2012-02-07
Posts: 10

Re: removing double quotes from filenames

Hi,

Try :

$ rename \" "" *

If you want to do it recursively :

$ shopt -s globstar
$ rename \" "" **

Last edited by ehmicky (2012-08-03 22:59:16)


Stego++, first general-purpose steganography library ever !
Will use most-used steganographic techniques as modules, with crypto and compression support, and high-quality security features. LGPL.
Release by end 2012. Contact me if you know crypto or stego and would be interested in team working with me.

Offline

Board footer

Powered by FluxBB