LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-11-2009, 06:09 AM   #16
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974

Quote:
Originally Posted by Tinkster View Post
Code:
echo -e "commons-logging-1.1.8\njslt-13.4.5-84.1" | sed -r 's/^([-a-z\.]+)-(.+)/\1 \2/'|while read arti vers;do echo $arti;echo $vers ;echo "";done
commons-logging
1.1.8

jslt
13.4.5-84.1
Like that?
mr sledgehammer, meet mr nut.
 
Old 05-11-2009, 06:56 AM   #17
crimson08
LQ Newbie
 
Registered: May 2009
Location: Smallville
Distribution: Ubuntu Hardy
Posts: 8

Original Poster
Rep: Reputation: 0
sorry for asking too much... but what if the artifact has a number on it?
example:

jsr109-1.2.3

artifactId=jsr109
version=1.2.3
 
Old 05-11-2009, 12:29 PM   #18
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by Tinkster View Post
Well ... as long as the "word" part of your artifactid
doesn't contain numbers, and the versions have no alpha
components it's still trivial.

If the conditions above DON'T apply I'd say you're
screwed unless you have a dictionary of your IDs,
since a parsing by lexicographic rules w/o language
knowledge is impossible.


cheers,
Tink
See above
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse String in a Bash script jimwelc Linux - Newbie 8 11-09-2012 08:47 AM
Want to compare strings in bash script IsharaComix Programming 6 10-28-2008 09:49 PM
Parse XML in bash script MikeyCarter Linux - Software 1 02-16-2007 02:19 PM
bash script help (arrays and strings from files) nkoplm Programming 14 12-02-2005 10:50 AM
bash script help to parse out text slack guy Linux - Newbie 3 12-30-2004 09:42 AM


All times are GMT -5. The time now is 01:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration