Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-21-2017, 11:12 AM   #1
LQ Newbie
Registered: Oct 2017
Posts: 2

Rep: Reputation: Disabled
Sed command throwing error Sun OS


I need some advice, following sed command is working good in Linux, but throwing error in Sun OS. This command is to remove lines which is > 512 length.

$ sed '/^.\{512\}./d' input > output
sed: command garbled: /^.\{512\}./d

Any advice would be helpful.


Old 10-21-2017, 11:40 AM   #2
Senior Member
Registered: Dec 2011
Location: Simplicity
Posts: 2,050

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Perhaps the number is too big?
sed '/^.\{255\}..\{255\}../d' input
2 members found this post helpful.
Old 10-21-2017, 12:07 PM   #3
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 18,808

Rep: Reputation: 6383Reputation: 6383Reputation: 6383Reputation: 6383Reputation: 6383Reputation: 6383Reputation: 6383Reputation: 6383Reputation: 6383Reputation: 6383Reputation: 6383
Which version (of OS) is it?
Old 10-21-2017, 09:18 PM   #4
LQ Newbie
Registered: Oct 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thumbs up


Thank you very much, it is working as expected (removing the lines with length > 510).

Best Regards,
Old 10-24-2017, 05:57 AM   #5
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 866

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
Welcome to LQ!!! Glad it's working. You can click on 'Solved' at top of page
(so future searchers can notice there's a solution here)

I'm curious which SunOS? (I worked with 4.x!) Does Oracle's dropping it affect your Co.?


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 command failing while substituting variable with error unterminated `s' command vnarvankar Linux - Software 2 03-10-2016 09:10 AM
Sed substitution gives error "sed: command garbled" gsai0205 Linux - Newbie 3 09-13-2013 09:01 AM
SED replace line command throwing parsing error when run through SSH uniami Linux - Newbie 3 03-09-2012 02:46 AM
sed command error saghi Linux - General 6 04-19-2009 03:27 AM
RPM Command not working, throwing undefined symbol error racurtis Linux - Software 2 04-03-2007 01:19 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:09 PM.

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
Open Source Consulting | Domain Registration