LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 04-15-2014, 04:34 AM   #1
suDoh!
LQ Newbie
 
Registered: Apr 2014
Location: Bangalore
Distribution: Precise Pangolin
Posts: 21

Rep: Reputation: Disabled
Question Need Advise in writing a Shell script using sed


Hey folks,

I have came across a question to create a script that shows lines containing trailing white spaces from a file implementing the sed editor.

My question is how do I check for trailing whitespaces using sed.

Footnote: sed always drives me crazy!

Cheers.
 
Old 04-15-2014, 05:41 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,121

Rep: Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270
what have you tried? How sed drives you crazy?
you need to construct a regexp to find lines containing trailing whitespaces. You can find a lot of pages by google, like this: https://www.linkedin.com/groups/SED-...299.S.77877460
 
Old 04-15-2014, 05:50 AM   #3
suDoh!
LQ Newbie
 
Registered: Apr 2014
Location: Bangalore
Distribution: Precise Pangolin
Posts: 21

Original Poster
Rep: Reputation: Disabled
Hey pan64,

Thanks for the URL... I'll check those and see if it helps.

Cheers.
 
  


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
Need help writing a simple sed script r_clark2 Programming 6 10-05-2012 04:58 AM
need a help for writing shell script suboss87 Red Hat 1 07-30-2012 09:00 AM
Writing shell script with sed,sql, and epoch milliseconds Eamo Programming 7 07-16-2007 04:40 PM
writing my first shell script speedhead34 Linux - Newbie 4 12-20-2004 01:50 AM


All times are GMT -5. The time now is 10:14 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