text to html

Tony Pursell ajp at princeswalk.fsnet.co.uk
Sat Jul 3 15:27:49 UTC 2010


On Sat, 2010-07-03 at 15:43 +0100, Martin Webster wrote:
> On Sat, 2010-07-03 at 11:07 +0200, Jozsi Avadkan wrote:
> 
> > i have to make a "one liner" that get's the input, and gives the
> > mentioned output. 
> 
> I'd throw together a simple Perl script and use regular expressions to
> get the desired output.
> 
> For example, read the file line-by-line (looking for a new line) and
> then use substitution:
> 
> my $line = "bash/get-ssl-certificate-from-a-domain.html";
> $line =~ s/^(.*)(\/)(.*)$/<br><font size=4>$1<\/font><br>\n<a href=
> \"$3">$3<\/a>\n/;
> print $line;
> 
> You'll need to add some control statements to deal with the repeated
> classes; bash, debian etc.
> 

Along the same lines a sed script could do the job.  I haven't done one
for years, but I don't mind having a go.

Tony
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100703/4021ba68/attachment.pgp>


More information about the ubuntu-users mailing list