LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 12-23-2015, 01:08 AM   #16
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191

Obviously it works, but I am not sure I always understand the purpose of having to farm the job to so many individual commands when a single one will do.
I do understand that some others may appear more complicated (or it could just be the user hasn't found the correct way to make it simpler ), but that may just mean there is a learning curve required.

I would mention that each pipe is effectively looping back over data already found, so would this not then be an explicit loop?
 
1 members found this post helpful.
Old 12-23-2015, 06:38 AM   #17
danielbmartin
Senior Member
 
Registered: Apr 2010
Location: Apex, NC, USA
Distribution: Mint 17.3
Posts: 1,881

Original Poster
Rep: Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660
Quote:
Originally Posted by grail View Post
... I would mention that each pipe is effectively looping back over data already found, so would this not then be an explicit loop?
Perhaps this is a matter of semantics.

From an on-line dictionary:
explicit = stated clearly and in detail, leaving no room for confusion or doubt.
implicit = implied though not plainly expressed.

As regards coding: a FOR loop, a DO loop, a WHILE or UNTIL loop is explicit.
It's right there, on the surface. You can't miss it.

A sed which uses a test-and-loop-back construct is explicit.

In this specific example the data passed from one command to the next is only ten lines.

Daniel B. Martin

Last edited by danielbmartin; 12-23-2015 at 07:31 AM. Reason: Add mention of sed
 
Old 12-23-2015, 07:33 PM   #18
danielbmartin
Senior Member
 
Registered: Apr 2010
Location: Apex, NC, USA
Distribution: Mint 17.3
Posts: 1,881

Original Poster
Rep: Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660
Thanks to everyone who contributed ideas and code to this thread.
It is marked SOLVED!

Daniel B. Martin
 
  


Reply

Tags
grep, sed



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
[Cygwin, sed] Using filenames as both files and search strings within sed lingh Linux - Newbie 5 10-20-2012 10:38 AM
select two substrings and merge as parameter via sed & grep plato79 Programming 11 07-16-2012 10:29 AM
[SOLVED] Select words with alphabetical-order character strings danielbmartin Programming 7 02-17-2012 12:08 AM
[SOLVED] Select a text between 2 strings (Perl) haux Programming 4 11-03-2011 08:58 AM
bash script with grep and sed: sed getting filenames from grep odysseus.lost Programming 1 07-17-2006 11:36 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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