Sponsored Content
Full Discussion: Perl + Korn + HTML
Top Forums Shell Programming and Scripting Perl + Korn + HTML Post 302222872 by i9300 on Thursday 7th of August 2008 07:20:24 PM
Old 08-07-2008
Perl + Korn + HTML

I have a perl script that prints up the html code and executes a few korn scripts to populate the web code.

Disclaimer === I can throw together some korn scripts pretty quick. This code changes pretty frequently. I don't know enough about perl to do everything I need. One day maybe I'll get there but for now -- This does work at least on the web side.

Basically I call a korn script in a variable with tics and print the var inside the html code....
See Below:

Code:
Perl Code:
$KSH_CHECK_SCRIPT="scripts/scriptname"; #Check script for UISSssh

foreach (<IN>) {
$HOST="$_";
$KSH_CHECK=`$KSH_CHECK_SCRIPT $HOST`;
print "<tr align=left><th width=20%>$HOST</th><th width=20%>yes</th><th width=20%>yes</th><th width=20%>$KSH_CHECK</th><th width=20%>yes</th></tr>";
}
close IN;

Keep in mind this does work and gives me my expected results. Pretty ? Prob not.

After churning the ksh script, it simply echos y or n
I would like to also echo some output to a file. The script does exactly that and works as designed when I execute either the ksh script by itself or from executing perl script from the command line.

My Problem.....
However when I call the perl script form the browser it will not output the additional info from the ksh script to the text file....

In the example below, it is line 32 the is not being executed when running the perl script from the browser.

Code:
    1  #!/bin/ksh
	SNIP out a bunch os variables 
    16  VER=$( sed -n "/$PKG/"'s/.*'"$PKG"'(\([^)]*\)).*/\1/p'  $COLLECT ) ## Thanks JP!
    17
    18  if [[ $VER = $CORRECT_VER ]];then
    19          if [[ $STATUS = N ]];then
    20              continue
    21          else
    22              STATUS=Y
    23          fi
    24  else
    25      STATUS=N
    26      MESSAGE="$MESSAGE Update Needed for ${PKG}:$VER to $CORRECT_VER"
    27  fi
    28
    29  if [[ $STATUS = Y ]];then
    30          echo "$STATUS"
    31  else
    32          print $MESSAGE >> $OUTPUT
    33          echo "$STATUS"
    34  fi

Again all the will work if I run the perl script form the command line.

Any Ideas?

-Chris
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl and html

hi. im very new to perl. is it possible to fill up a web form and submit it using perl? example, i would like to sign up for a yahoo account though a perl script (ofcourse, granting the "type the characters as shown in imgage" is absent)? (8 Replies)
Discussion started by: marcpascual
8 Replies

2. Shell Programming and Scripting

HTML parsing by PERL

i have a HTML report file..its in attachment(a part of the whole report is attached..name "input html.doc").also its source is attached in "report source code.txt" i just want to seperate the datas like in first line it should be.. NHTEST-3848498958-NHTEST-10.2-no-baloo a and so on for whole... (3 Replies)
Discussion started by: avik1983
3 Replies

3. Shell Programming and Scripting

Korn Shell and Perl Administrative Script

I have this script that I want to be able to scan a list of IP address from a file (namlist and snifflist)and Hostnames of network devices to see if they are alive or down and if telnet port 23 is open. I originally started to write this in Korn Shell and ran into some issue trying to closed a... (0 Replies)
Discussion started by: metallica1973
0 Replies

4. Shell Programming and Scripting

Converting html to pdf perl

Hi All, I have a requirement of converting an html form into pdf using perl. The html form contains images, tables and css implementation. I tried using various perl modules but failed to achive the target. I succeeded in generating a pdf from the html file using... (2 Replies)
Discussion started by: DILEEP410
2 Replies

5. Shell Programming and Scripting

HTML Encoded characters -- Perl

Hello all I have a string like " Have Fun for the rest of the day !. I will meet you tomorrow!" ! is the HTML Equivalent of ! symbol. From the above string, i would like to remove only the HTML encoded special characters. Output should be like " Have Fun for the rest of the day... (4 Replies)
Discussion started by: vasuarjula
4 Replies

6. Shell Programming and Scripting

Embedding HTML in Perl script

My webpage is hosted from perlscript(homepage.pl), i want to add piece of html code in the footer of the homepage. I simply pasted the html code at the end of the perl script as below... ======================================================== close(OUTSQL); ... (4 Replies)
Discussion started by: paventhan
4 Replies

7. Shell Programming and Scripting

HELP on Perl array / sorting - trying to convert Korn Shell Script to Perl

Hi all, Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM. Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers. At the moment am... (3 Replies)
Discussion started by: newbie_01
3 Replies

8. UNIX for Advanced & Expert Users

Calling PERL from a Korn shell script

I am currently in Afghanistan and do not have access to some of the resources I normally do back in the US. Just accessed this site and it looks promising! Hopefully you will not find my question too much of a waste of your time. I write mostly Korn Shell and PERL on Solaris systems for the... (2 Replies)
Discussion started by: mseanowen
2 Replies

9. UNIX for Dummies Questions & Answers

Writing an HTML file in perl

I'm writing a perl script that writes an html file. use Tie::File; my ($dir) = @ARGV; open (HTML,">","$dir/file.html") || die $!; #-----Building HTML file--------------------------- print HTML "<!DOCTYPE html> <html> <head> <title>Output</title> <link... (3 Replies)
Discussion started by: jrymer
3 Replies
CHRONICLE-ENTRY-FILTER(1)				User Contributed Perl Documentation				 CHRONICLE-ENTRY-FILTER(1)

NAME
chronicle-entry-filter - Convert blog files to HTML, if required. SYNOPSIS
Help Options --help Show a brief help overview. --version Show the version of this script. Options --format The global format of all entries. --filename The name of the single file to process. Filters --pre-filter A filter to run before convertion to HTML. --post-filter A filter to run after HTML conversion. ABOUT
This script is designed to receive a filename and a global formatting type upon the command line. The formatting type specifies how the blog entry file will be processed: 1. If the format is "textile" the file will be converted from textile to HTML. 2. If the format is "markdown" the file will be converted from markdown to HTML. The related format "multimarkdown" is also recognised. 3. If the format is "html" no changes will be made. Once the conversion has been applied the code will also be scanned for <code> tags to expand via the Text::VimColour module, if it is installed, which allows the pretty-printing of source code. To enable the syntax highlighting of code fragments you should format your code samples as follows: Subject: Some highlighted code. Date: 25th December 2009 Tags: chronicle, perl, blah <p>Here is some code which will look pretty ..</p> <code lang="perl"> #!/usr/bin/perl -w ... .. </code> Notice the use of lang="perl", which provides a hint as to the type of syntax highlighting to apply. Additionally you may make use of the pre-filter and post-filter pseudo-headers which allow you to transform the entry in further creative fashions. For example you might wish the blog to be upper-case only for some reason, and this could be achieved via: Subject: I DONT LIKE LOWER CASE Tags: meta, random, silly Date: 25th December 2009 Pre-Filter: perl -pi -e "s/__USER__/`whoami`/g" Post-filter: tr [a-z] [A-Z] <p>This post, written by __USER__ will have no lower-case values.</p> <p>Notice how my username was inserted too?</p> You may chain arbitrarily complex filters together via the filters. Each filter should read the entry on STDIN and return the updated content to STDOUT. (If you wish to apply a global filter simply pass that as an argument to chronicle, or in your chroniclerc file.) AUTHOR
Steve -- http://www.steve.org.uk/ LICENSE
Copyright (c) 2009-2010 by Steve Kemp. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license. perl v5.12.3 2011-05-03 CHRONICLE-ENTRY-FILTER(1)
All times are GMT -4. The time now is 07:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy