Monday, January 19, 2015

Re: [LINUX_Newbies] Help with script and regex.

 

Snipped everything but part of Cameron's reply because that's what I'm
really commenting about (though the comment is directed at the OP, not
Cameron)

On Mon, Jan 19, 2015 at 5:54 PM, Cameron Simpson cs@zip.com.au
[LINUX_Newbies] <LINUX_Newbies@yahoogroups.com> wrote:

> {2009}«{12}«{04}«{PHOTOS}«{Pictures}

I'm kinda curious about why the need for {} and << in a file name and
path? Given that in BASH and DASH, at least, both are special shell
characters, right?

Because to type that out on a shell (which you'd need to do in most
scripts, right? maybe not in python, perhaps, but anything that is
done in shell) you'd need to escape all that, and end up looking like
this when typed in manually:

# \{2009\}|\<\<\{12\}\<\<\{04\}\<\<\{PHOTOS\}\<\<\{Pictures\}

Even in sed or awk, I believe you'd need to escape all that, I think.
But I say that without trying it out, so YMMV it may be easier than
what I'm imagining.

Personally, my photos are all categorized more descriptively (and more
shell friendly for times when I need to use a shell script on one or
more directories and filenames:

/Photography/2014/2014-04-25_Some_Event/raw/2014-04-25_Some_Event-001.raw
/Photography//2014/2014-04-25_Some_Event/processed/2014-04-25_Some_Event-001.jpg

Anyway, point is, if you want to use shell scripts on things, it
really pays to not use special shell constructs in the naming
convention.

But that's just my opinion...

__._,_.___

Posted by: J <dreadpiratejeff@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)
To unsubscribe from this list, please email LINUX_Newbies-unsubscribe@yahoogroups.com & you will be removed.

.

__,_._,___

No comments:

Post a Comment