[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Mon Nov 15 18:12:50 2004 -->
- <!--x-from-r13: qbpk ng vb.pbz (Rlyna @beguehc) -->
- <!--x-message-id: Pine.LNX.4.44.0411151658450.23675-[email protected] -->
- <!--x-reference: 1100558992.2837.18.camel@blue --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] scripting foo -->
- <li><em>date</em>: Mon Nov 15 18:12:50 2004</li>
- <li><em>from</em>: docx at io.com (Dylan Northrup)</li>
- <li><em>in-reply-to</em>: <1100558992.2837.18.camel@blue></li>
- <li><em>subject</em>: [ale] scripting foo</li>
:=I'm looking for some opinions on a better way to do something that I
:=currently do as part of a much larger lengthy script. Basically I
:=have a program that outputs data in the following format (sans the
:=hashed lines):
:=
:=-----------------------------------
:=5 colors match RGB search:
:= red
:= yellow
:= orange
:= blue
:= green
:=-----------------------------------
:=
:=Without using perl, and only using common progs (awk,sed,cut,etc), what
:=is the most optimized way to return a sorted, left-justified, right-trimmed,
:=list of results like this:
:=
:=-----------------------------------
:=blue
:=green
:=orange
:=red
:=yellow
:=-----------------------------------
:=
:=
:=Tia,
Using bash:
plato> cat blah
5 colors match RGB search
red
yellow
orange
blue
green
plato> cat blah | grep -v RGB | sed -e 's/^[ ^V^I]*//' | sort
blue
green
orange
red
yellow
Note, you'll have to use the ^V^I to make a literal tab that sed will cut
out.
*sigh* All this unix kung-fu and nobody to hire me.
--
Dylan Northrup - docx at io.com - <a rel="nofollow" href="http://www.io.com/~docx/">http://www.io.com/~docx/</a>
"Harder to work, harder to strive, hard to be glad to be alive, but it's
really worth it if you give it a try." -- Cowboy Mouth, 'Easy'
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00671" href="msg00671.html">[ale] scripting foo</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00666" href="msg00666.html">[ale] scripting foo</a></strong>
<ul><li><em>From:</em> jimpop at yahoo.com (Jim Popovitch)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00666.html">[ale] scripting foo</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00668.html">[ale] scripting foo</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00666.html">[ale] scripting foo</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00671.html">[ale] scripting foo</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00667"><strong>Date</strong></a></li>
<li><a href="threads.html#00667"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>