<div dir="ltr">that is exactly the way I wanted to know. you are a great guy!</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 30, 2016 at 2:52 PM, Brian Cluff <span dir="ltr"><<a href="mailto:brian@snaptek.com" target="_blank">brian@snaptek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
\s does match any white space and is very different than /s. In my
example this is what everything means<br>
<pre><span style="font-size:12.8px">rename 's/:/-/' *
0 12345678 9
</span></pre>
0 - name of program<br>
1 - the following should be interpreted literally by the shell<br>
2 - we are going to do a regular expression search and replace<br>
3 - Regular expression start character (you can actually change this
to any character you like in your regular expression is going to
contain slashes (/), but stick with / to begin with.<br>
4 - The search pattern that will be searching for, in this case a
colon<br>
5 - the seperator beween the search and replace<br>
6 - the pattern that we will be replacing our search matched with,
in this case a -<br>
7 - the end our of regular expression<br>
8 - stop interpreting everything literally<br>
<br>
There are options that you can add after the last / that can make
your regular expression case insensitive (i) or make it work more
than once on the same line (g)...etc.etc.. but there aren't any in
this case as they aren't needed.<br>
<br>
9 - this star is now shell globing and makes the command operate on
all the files in the current directory. In your case it would
probably be better to do *:* so that it only touches files with a :
in their names, so that you limit the damage if you get something
wrong.<br>
<br>
I'm sure that's now as clear as mud. :)<span class="HOEnZb"><font color="#888888"><br>
<br>
Brian Cluff</font></span><div><div class="h5"><br>
<br>
<div>On 01/30/2016 12:26 PM, Michael wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">you know... the reason I was doubting that page is
because it says that \s matches any white space and in the
example that worked:
<div><br>
</div>
<div><span style="font-size:12.8px">rename 's/:/-/' *</span><br style="font-size:12.8px">
</div>
<div><span style="font-size:12.8px"><br>
</span></div>
<div><span style="font-size:12.8px">looks to me as if it is
saying to search for a blank space followed by a colon and
then (i guess) the next forward slash tells it to replace it
with a dash. Then the final '\' closes the statement and
that too is a tatement surrounded by apostrapheses.</span><br>
</div>
<div><span style="font-size:12.8px">Is that right?</span></div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sat, Jan 30, 2016 at 2:09 PM, Brian
Cluff <span dir="ltr"><<a href="mailto:brian@snaptek.com" target="_blank">brian@snaptek.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> Regular expressions
is a pretty big topic. It's not super easy like globing
(like the * you've been using in bash) which you can get
the idea from the 544 page book ( <a href="http://www.amazon.com/Mastering-Regular-Expressions-Jeffrey-Friedl/dp/0596528124/" target="_blank"></a><a href="http://www.amazon.com/Mastering-Regular-Expressions-Jeffrey-Friedl/dp/0596528124/" target="_blank">http://www.amazon.com/Mastering-Regular-Expressions-Jeffrey-Friedl/dp/0596528124/</a>
) that can be bought on regular expressions. The
equivalent book on globing would be a pamphlet. <br>
<br>
That being said, the basics aren't too hard to learn, but
you have to keep in mind that they are fairly different,
and don't always act like what you would think.<br>
<br>
There are a ton of howtos out there and they take a lot of
different approaches to explaining thing, I would just
search google for them until you find one that speaks to
you.<span><font color="#888888"><br>
<br>
Brian Cluff</font></span>
<div>
<div><br>
<br>
<div>On 01/30/2016 11:54 AM, Michael wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">thank you Brian. Does anyone happen
to know of a perl regexr list. I found one but am
not sure if it is right: <a href="http://www.cs.tut.fi/%7Ejkorpela/perl/regexp.html" target="_blank">http://www.cs.tut.fi/~jkorpela/perl/regexp.html</a></div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sat, Jan 30, 2016 at
11:43 AM, Brian Cluff <span dir="ltr"><<a href="mailto:brian@snaptek.com" target="_blank"></a><a href="mailto:brian@snaptek.com" target="_blank">brian@snaptek.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> You
can't rename files that way. The * on the
command line gets turned into real file
names by bash before they are ever given to
the mv command so you are tell the command
line to consist of any files with a :
followed by any files with an = or -.<br>
At best your command will error out, at
worst it will overwrite an existing file.<br>
What you are needing is a program that can
take a pattern and rename files with a
different pattern. There are 2 that I've
used, mmv and rename. Of the 2, you
probably have rename on your system already
since it gets pulled in with PERL. If not,
just install the rename package.<br>
<br>
With rename all you have to do is:<br>
rename 's/:/-/' *<br>
<br>
That will use a regular expression to change
all the files in the current directory that
contain a : in their name to the same name
with a - replacing the :.<br>
<br>
Be very very careful with the rename
command, it can and will clobber every file
that it touches before you know it just
because you got a single character out of
place.<br>
When in doubt add the -n option so that it
will tell you what it's going to do without
actually doing it. Then if everything looks
good, run the command again without the -n
to actually make the changes.<span><font color="#888888"><br>
<br>
Brian Cluff</font></span>
<div>
<div><br>
<br>
<br>
<div>On 01/30/2016 08:29 AM, Michael
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">I'm sure that will fix
it but what am I doing wrong in my
attempts to rename them?
<div><br>
</div>
<div>
<div>$ mv *:* *=*</div>
<div>mv: target ‘*=*’ is not a
directory</div>
<div>$ mv *:* *-*</div>
<div>mv: target
‘darktable-1:9Download’ is not a
directory</div>
<div>$ mv *:* ./*-*</div>
<div>mv: target
‘./darktable-1:9Download’ is not
a directory</div>
<div><br>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sat, Jan
30, 2016 at 10:29 AM, Matt Graham
<span dir="ltr"><<a href="mailto:mhgraham@crow202.org" target="_blank"></a><a href="mailto:mhgraham@crow202.org" target="_blank">mhgraham@crow202.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On
Fri, Jan 29, 2016 at 6:45 PM,
Michael <<a href="mailto:bmike1@gmail.com" target="_blank"></a><a href="mailto:bmike1@gmail.com" target="_blank">bmike1@gmail.com</a>>
wrote:<br>
</span>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
the filesystem is probably
FAT because it is a thumb
drive....<br>
</span><span> rsync: mkstemp
"/media/bmike1/RedSanDisk/Documents/Education/Darktable/.darktable-1:10WaterLilyEdit.CccL3o"
failed: Invalid argument
(22)<br>
</span></blockquote>
<br>
It is not possible to have a ':'
character in a filename on a
FAT-based filesystem. This is
because that character was used
to denote which disk drive a
file was on back in the DOS
days... "C:\junk\stuff.txt" and
so forth.<br>
<br>
I am not sure what these hidden
files contain, or whether
they're actually important. You
can pass the "--exclude *\:*"
option to rsync to tell it to
not try to transfer files that
contain ':' characters, which
may help.<span><font color="#888888"><br>
<br>
-- <br>
Crow202 Blog: <a href="http://crow202.org/wordpress" rel="noreferrer" target="_blank"></a><a href="http://crow202.org/wordpress" target="_blank">http://crow202.org/wordpress</a><br>
There is no Darkness in
Eternity<br>
But only Light too dim for
us to see.</font></span>
<div>
<div><br>
---------------------------------------------------<br>
PLUG-discuss mailing list -
<a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe,
or to change your mail
settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" rel="noreferrer" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div><span style="font-size:12.8000001907349px">:-)~MIKE~(-:</span><br>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>---------------------------------------------------
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a>
To subscribe, unsubscribe, or to change your mail settings:
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a></pre>
</blockquote>
<br>
</div>
</div>
</div>
<br>
---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank"></a><a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your
mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" rel="noreferrer" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div><span style="font-size:12.8000001907349px">:-)~MIKE~(-:</span><br>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>---------------------------------------------------
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a>
To subscribe, unsubscribe, or to change your mail settings:
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a></pre>
</blockquote>
<br>
</div>
</div>
</div>
<br>
---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" rel="noreferrer" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div><span style="font-size:12.8000001907349px">:-)~MIKE~(-:</span><br>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>---------------------------------------------------
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a>
To subscribe, unsubscribe, or to change your mail settings:
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a></pre>
</blockquote>
<br>
</div></div></div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" rel="noreferrer" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-size:12.8000001907349px">:-)~MIKE~(-:</span><br></div></div></div></div></div>
</div>