Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
While the Subject line says BASH, I'm not averse to other scripting solutions (awk, perl, etc.).
Years ago, I was greatly impressed by Extensis Portfolio's innate ability to alphabetically sort keywords and supplemental categories added to those picture file types that supported IPTC and XMP metadata. I have yet to find another application, GUI or CLI, that does this in any OS on any hardware platform, and I've been searching off and on since 1996.
In the meantime, I've "taken the job in hand" to do my own descriptive metadata writing alphabetically. Here's where I've run into a problem. I don't always think alphabetically when describing a picture I wish to add keywords and supplemental categories to, and rearranging by hand can get tedious; even when it's not, it's somewhat time-consuming.
I've also encountered situations where, when adding a new key or supplemental to a picture's metadata, most GUI apps attach it to the end of the set, which means more editing on my part.
To make quick work of this editing is what I'm after. The best I've come up with in BASH shell is
Except for the trailing comma, I'd be satisfied. Call it petty, but a few months back, I rewrote three or four BASH scripts in such a way that a trailing comma was made part of the text, instead of being seen as a delimiter. I suppose editing out one comma takes far less time than rearranging whole strings of words, but frankly, I'd rather not have to.
As I mentioned before, I'm not married to, or insistent on, a BASH solution.
Looking forward to any help on this plane,
BZT
Last edited by SilversleevesX; 11-29-2011 at 11:21 AM.
Reason: Two strings did not match for content
I'm going to copy your script suggestion and as soon as I have msort installed, I'll try it out on a few strings. Good to hear it's so well documented.
BZT
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.