The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 02-14-2008
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,631
Quote:
Originally Posted by fpmurphy View Post
A more general solution using sed is
You are right of course. I wouldn't have limited it if the thread-starter wouldn't have explicitly stated that the character could only be "N" or "U".

Perhaps it is a matter of programming philosophy (which is not the topic of this thread - at least not directly), i would prefer my solution over the general one followed by a line catching all the lines not matched by my solution to point them out as suspicious - lines which "shouldn't exist" at all.

The point is: if a specification says that the specific character can only be "N" or "U", then i would like to be informed if a line with neither "N" or "U" on it comes up. Maybe the specification has changed, maybe my script is faulty, maybe some pre-processing steps producing the lines are faulty - whatever. At least there is *something* that might have to be dealt with.

With all due respect
bakunin