ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I've been running Linux for about six years, but only now have the need to do string-manipulation for a project, before I was just doing network services and stuff.
My problem is that I'm a bonehead with 'sed'. All I want to do is remove everything from the output of a line before the divider. I already know where to put sed in this command, and this is simplified, but the OUTPUT is what I need to modify.
#for mp3 in ./*/*/*.mp3 ; do openssl dgst -sha1 "$mp3" ; done
SHA1(./Philip Glass/Powaqqatsi/Anthem - Part 2.mp3)= a686a5a167efa758c404a3a3283975406daf7486
SHA1(./Philip Glass/Powaqqatsi/Anthem - Part 3.mp3)= 7f3b426bb0db39b3aac78f738e2f355086428b86
SHA1(./Philip Glass/Powaqqatsi/Mosque And Temple.mp3)= d3da57bcc03bd3bb4b68e2473e0adababa570d6b
So, what I want to do is get ONLY the hashes of the files. I need to remove (in my own head's language) '*=\ '.
The problem is that I can't figure out how to tell sed to stop filtering characters when it hits the '= ', and I have a nagging suspicion that there's a better way, by issuing a command to remove everything before '= ', but I don't know how.
This was originally part of a script on Mac OS X that I wrote, and on OS X the 'md5 -q' command outputs ONLY the hash, so it was easy. Now I'm trying to make it work here at home on linux (for testing) and I don't have that command.