Sponsored Content
Top Forums Shell Programming and Scripting Output Display in a perl program Post 302577475 by rocker_me2002 on Tuesday 29th of November 2011 06:53:08 AM
Old 11-29-2011
The first line points to the perl path.
Try changing it to correct windows path.

like

Code:
#!C:\perl\bin\perl.exe

Quote:
Originally Posted by mr_manii
#!/usr/bin/perl
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Display a Graphic from a Unix program on a Pc – how?

An interesting puzzle. I run character based compiled C-Programs in a Unix environment on PCs in a Window. I want to be able to call up and display in a separate window a picture of a product called by a Unix shell script from within my Unix program. Ideally I would like to have a script that... (4 Replies)
Discussion started by: Barry Staples
4 Replies

2. Programming

program or script to display user info

I'm on a Linux machine and need a program that will display user information as follows: user name, user directory and current date & time. I think we can compile C, C++ and Perl. All help is appreciated. (4 Replies)
Discussion started by: flasun
4 Replies

3. Shell Programming and Scripting

Net::SSH::Perl->Execute any unix command & display the output in a proper form

Net::SSH::Perl ...... how to print the output in a proper format my $cmd = "ls -l"; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd("$cmd"); print $stdout; the script works fine, but i am unable to see the output... (2 Replies)
Discussion started by: gsprasanna
2 Replies

4. Shell Programming and Scripting

how to display the output file in an html format using perl

Hi, I have written a perl script to dispaly some statements from a file but i want the output statements to be dispalyed in an HTML format.Is it possible for me to do in perl scripting? Please help me with ur thoughts. Thanks In Advance Meva. (1 Reply)
Discussion started by: meva
1 Replies

5. Shell Programming and Scripting

Display output bash program

Hello, i have a problem with the output from my bash program. I made this program #!/bin/bash BESTANDEN=$* # Plaatst bestanden in de variabele BESTANDEN TMPFILE=xmlprog.sh.$$.$RANDOM # basisnaam voor tijdelijke bestanden # controller of het programma correct is aangeroepen if then ... (6 Replies)
Discussion started by: dutchspiders
6 Replies

6. Homework & Coursework Questions

Calling compiled C program with Perl program

Long story short: I'm working inside of a Unix SSH under a bash shell. I have to code a C program that generates a random number. Then I have to call the compiled C program with a Perl program to run the C program 20 times and put all the generated random #s into a text file, then print that text... (1 Reply)
Discussion started by: jdkirby
1 Replies

7. Programming

To display unique lines in a Program

I am new to C programming. I have been trying to display unique lines in a file from past two days. The problem is here, I have a file whose contents are, ras.beamtele.net ras.beamtele.net ras.beamtele.net ras.beamtele.net ras.beamtele.net ras.beamtele.net ras.beamtele.net... (1 Reply)
Discussion started by: Teju88
1 Replies

8. Programming

C program to display a busy symbol while processing

Hi I was wondering how can a c program will be implemented which will display a symbol while calculating something. for example : program should display some charters like /\/\ while calculating. At least provide some pointers thanks (4 Replies)
Discussion started by: rakeshkumar
4 Replies

9. Shell Programming and Scripting

getting no output with my perl program

hi, i have posted the same kind of the question in some other forum of the same site. but realized that it is supposed to be here so i am reposting it .this is the perl script written to check for particular pattern. my file 1 would look like this hwk:678:9878:asd:09: abc cfgb 12 nmjk ......... (3 Replies)
Discussion started by: anurupa777
3 Replies

10. Shell Programming and Scripting

Perl program get a response before the program quits

I created a program, so a kid can practice there math on it. It dispenses varies math problems and the kid must input an answer. I also want it to grade the work they have done, but I can't find the best place for it to print out the grade. I have: if ( $response =~ m/^/ ) { $user_wants_to_quit... (1 Reply)
Discussion started by: germany1517
1 Replies
HTML::Template(3ruby)													     HTML::Template(3ruby)

NAME
HTML::Template - Ruby extension for HTML::Template DESCRIPTION
This module deals with HTML template by CGI scripts and use a complete selectivity between design and logic easily. You can deal with a nested block, a loop and a conditional expression. Simple example, see below. template file test.html <HTML> <HEAD><TITLE>Test Template</TITLE> <BODY> My Home Directory is <!var:home> <P> My Path is set to <!var:path> </BODY> </HTML> Ruby script require "html/template" tmpl = HTML::Template.new("./test.html") tmpl.param({ 'home' => ENV['HOME'], 'path' => ENV['PATH'] }) print "Content-Type: text/html " print tmpl.output INSTALL
using install.rb % tar xvzf html-template-x.xx.tar.gz % cd html-template-x.xx % ruby install.rb config % ruby install.rb setup % su # ruby install.rb install Template File TAGS
You can use original style tag or valid HTML comment style tag. <!var:PARAMETER_NAME> <!-- var:PARAMETER_NAME --> When you call HTML::Template#param ({PARAMETER_NAME => VAL}), tags will be simply replaced to VAL. <!begin:PARAMETER_NAME> <!end:PARAMETER_NAME> <!-- begin:PARAMETER_NAME --> <!-- end:PARAMETER_NAME --> It allows you to separate a section of text and give it a name It would be able to make them loop or conditional expression. And, it can be nested. <!include:FILE_NAME> <!-- include:FILE_NAME --> A file specified by FILE_NAME is simply inserted to a template file. The template file will be treated as a merged template. If you pass the path param to HTML::Template.new , include file will be searched under the path. HTML
::Template CLASS CLASS METHODS
HTML::Template.new(params = {}) Creates a HTML::Template object. Given a file name to its first argument, use this file as a template. Also you can pass params as Hash. The options are below o filename template filename o path template search path. you can specified as String or Array of String. METHODS
HTML::Template#load(file) Load template file. HTML::Template#set_html(html) Setting up a string as a template. HTML::Template#param(hash = {}) HTML::Template#expand(hash = {}) Specifies a string or a loop by Hash for a substitute. When specifying more than a loop simultaneously, value of the hash becomes an array. HTML::Template#node(name) HTML::Template#loop(name) HTML::Template#cond(name) Stands a loop and a conditional expression specified by <!begin:name><!end:name> Retrieves HTML::TemplateNode object. HTML::Template#output HTML::Template#to_s Returns the final result. HTML
::TemplateNode CLASS This is a class for a loop or a conditional expression. An instance consists of HTML::Template Class and HTML::TemplateNode CLASS. METHODS
HTML::TemplateNode#node(name) Stands a loop or a conditional expression specified by <!begin:name><!end:name> Returns HTML::TemplateNode object. Is only used for nested. HTML::TemplateNode#param(hash = {}) HTML::TemplateNode#expand(hash = {}) HTML::TemplateNode#add(hash = {}) Specifies a string or a loop by Hash for a substitute. If you don't call the method, the block won't be displayed. A LOOP
This sample is a displaying list of environment valiables. <html> <body> <h1>Env List</h1> <hr> <!begin:envlist> <!var:key> : <!var:val><br> <!end:envlist> <hr> </body> </html> # In case of using it with iterator and replace data. require "html/template" tmpl = HTML::Template.new("filename" => "envlist.html") ENV.keys.sort.each do |k| tmpl.node("envlist").param({'key' => k, 'val' => ENV[k] }) end print "Content-Type: text/html " print tmpl.output # In case of giving a loop as an array require "html/template" tmpl = HTML::Template.new("envlist.html") envlist = [] ENV.keys.sort.each do |k| envlist.push({'key' => k, 'val' => ENV[k] }) end tmpl.param({'envlist' => envlist}) print "Content-Type: text/html " print tmpl.output A Conditional Expression <html> <body> <!begin:true> This is True <!var:foo> <hr> <!end:true> <!begin:false> This is False <!var:foo> <hr> <!end:false> </body> </html> require "html/template" tmpl = HTML::Template.new("cond.html") tmpl.param({'true' => {'foo' => 'foobar'} }) print "Content-Type: text/html " print tmpl.output The performed result is below, however, a part not specied with the method isn't displayed. <html> <body> This is True foobar <hr> </body> </html> An attached Sample. env.rb This sample is a simply replacing valiables. envlist.rb This sample is a displaying list of environment valiables. This sample is a case for using with iterator. envlist2.rb Performed result is the same as the envlist.rb.'s. nest.rb A sample of a nested loop. THANKS
English Documentation NAKAYAMA Nao <nao_o@netlaputa.ne.jp> thanks a lot :-) AUTHOR
Copyright 2001 IKEBE Tomohiro This library is free software; you can redistribute it and / or modify it under the same terms as Ruby itself. IKEBE Tomohiro <ikechin@Oxfa.com> June 2002 HTML::Template(3ruby)
All times are GMT -4. The time now is 09:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy