LinuxQuestions.org
Help answer threads with 0 replies.
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 10-21-2017, 11:12 AM   #1
iqbalns
LQ Newbie
 
Registered: Oct 2017
Posts: 2

Rep: Reputation: Disabled
Sed command throwing error Sun OS


Hi,

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.

Thanks.


Regards,
Iqbal
 
Old 10-21-2017, 11:40 AM   #2
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 1,770

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

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

Original Poster
Rep: Reputation: Disabled
Thumbs up

Hi,

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


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

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
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.?
 
  


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
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:17 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
Open Source Consulting | Domain Registration