Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-25-2010, 10:13 AM   #16
Registered: Aug 2003
Location: London, UK
Distribution: Debian and Fedora for play and RHEL + Solaris for work
Posts: 172

Original Poster
Rep: Reputation: 15

Thanks to everyone for your help!

Unfortunately -r doesn't seem to be valid with the Solaris Sed:

$ echo 123456789 | sed -r ':a s/([0-9]+)([^,]{3})/\1,\2/;ta'
sed: illegal option -- r
Usage:  sed [-n] script [file...]
        sed [-n] [-e script]...[-f script_file]...[file...]
But using GNU sed:

$ echo 123456789 | sed -r ':a s/([0-9]+)([^,]{3})/\1,\2/;ta'
Which is a pity really, because I agree that in statements such as this it is much clearer to be able to drop the back slashes.


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
sed - testing multiline search and replace webhope Programming 11 05-13-2010 02:21 PM
sed multi-line search/replace woes djmm Programming 8 03-17-2009 05:25 AM
sed search replace tomerbd1 Linux - General 9 04-10-2008 04:31 AM
sed question for search and replace jakev383 Linux - General 8 05-05-2007 05:40 AM
sed search & replace sharathkv25 Programming 2 03-07-2007 10:16 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:42 AM.

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