The UNIX and Linux Forums  


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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
List certain file in a folder and make list andrisetia UNIX for Dummies Questions & Answers 1 09-15-2008 02:21 PM
help with sorting sequence in Unix C:sort -t ':' +0 -1 -n +1 -2 +2 -3 -o list list gurvinder UNIX for Advanced & Expert Users 6 08-27-2008 04:20 PM
counting a list of string in a list of txt files Pep Puigvert UNIX for Dummies Questions & Answers 4 08-15-2008 04:55 PM
Drag and drop items in plain html page matrixmadhan UNIX for Dummies Questions & Answers 1 08-08-2008 12:06 AM
send email from address list and subject list paulds UNIX for Dummies Questions & Answers 2 06-27-2008 11:11 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-09-2009
QuestunAthority QuestunAthority is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 2
Plain Text List to HTML List

Hello, I am trying to take a simple list (from echo, not a file) and turn it into a list with HTML codes.

List item one.
List item two.
List item three.

to

<ol>
<li>List item one.</li>
<li>List item two.</li>
<li>List item three.</li>
</ol>


The list is coming in via echo on standard input, and going to standard output.

(I am using OnMyCommand so my plan is that all I have to do is select the list, and choose the right command and it's pasted in place.

I have made some really simple commands in OMC for adding <b></b> tags around text, which is similar to this forums adding of tags. But trying to figure out sed and grep are too much for me for now. The main problem I've been having is trying to get the newlines in place, but for all intents and purposes, I'm back at square one, or should I say square zero. :-) )


I am not wed to any command line program, but it seems sed is the going to be best.

Any help appreciated! (I've searched all over and can't seem to cobble this together. I'm on OS X 10.4 and I believe bash is the default shell.)
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:40 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0