Perl CGI executing command line functions

I am just starting out with Perl and am trying to figure out how to
setup a CGI script to perform some command line functions.  I work
with some people that need to run some command line functions but we
do not want to give them command line access.  I thought that if I
write a Perl CGI script that executes some of the commands for them,
it would solve our problems.

I have found tons of examples and tutorials that show you how to get a
Perl CGI to write to files, display HTML pages and print lines.  What
is the correct syntax for backticks in Perl?  My goal was to give them
allow
them access to some HTML pages with some forms where they enter the
options for certain commands.

For example, if I had this as my HTML form and the user entered "-al"
<form action="dosomething.cgi" method="GET">  
Enter an #ls option:  <input type="text" name="commd" size=30><p>
<input type="submit">
</form>  

How would I get Perl to run that #ls command with the user's option
values (#ls -al) and display the end result of that command?
Would it be something similar to 
`ls` $commd;
How would I show the end result?

Thanks in advance,
Nick
0
kvetchv (1)
10/1/2003 9:07:57 PM
comp.lang.perl.misc 32973 articles. 7 followers. brian (1246) is leader. Post Follow

14 Replies
668 Views

Similar Articles

[PageSpeed] 24
In article <3eb8c8ea.0310011307.6f17ae73@posting.google.com>,
 kvetchv@yahoo.com (Nick) wrote:

> I am just starting out with Perl and am trying to figure out how to
> setup a CGI script to perform some command line functions.  I work
> with some people that need to run some command line functions but we
> do not want to give them command line access.  I thought that if I
> write a Perl CGI script that executes some of the commands for them,
> it would solve our problems.
> 
> I have found tons of examples and tutorials that show you how to get a
> Perl CGI to write to files, display HTML pages and print lines.  What
> is the correct syntax for backticks in Perl?  My goal was to give them
> allow
> them access to some HTML pages with some forms where they enter the
> options for certain commands.
> 
> For example, if I had this as my HTML form and the user entered "-al"
> <form action="dosomething.cgi" method="GET">  
> Enter an #ls option:  <input type="text" name="commd" size=30><p>
> <input type="submit">
> </form>  
> 
> How would I get Perl to run that #ls command with the user's option
> values (#ls -al) and display the end result of that command?
> Would it be something similar to 
> `ls` $commd;
> How would I show the end result?
> 
> Thanks in advance,
> Nick

the most naive way would be this:

#----------------------------------------
#!perl -w

use strict;
use CGI qw/:standard/;

$|++;

print header();

my $commd = param('commd');

print `ls $commd`;
#----------------------------------------

however... think of what would happen if the user entered "; rm -fr *.*" 
!!!!!!!

you might wanna constrain what is allowable...
-- 
Michael Budash
0
Michael
10/1/2003 9:24:25 PM
It was a dark and stormy night, and Nick managed to scribble:

> I am just starting out with Perl and am trying to figure out how to
> setup a CGI script to perform some command line functions.  I work
> with some people that need to run some command line functions but we
> do not want to give them command line access.  I thought that if I
> write a Perl CGI script that executes some of the commands for them,
> it would solve our problems.

Use the 'system' command. You will probably nned fully qualified paths if you use CGI.

gtoomey
0
Gregory
10/1/2003 9:26:37 PM
Nick wrote:
> I work with some people that need to run some command line
> functions but we do not want to give them command line access.  I
> thought that if I write a Perl CGI script that executes some of the
> commands for them, it would solve our problems.

*Some* of the commands? Do they have access to upload and run their
own CGI scripts? In that case, what prevents them from uploading a
script and executing *any* system command?

Just a thought.

> For example, if I had this as my HTML form and the user entered
> "-al"
> <form action="dosomething.cgi" method="GET">
> Enter an #ls option:  <input type="text" name="commd" size=30><p>
> <input type="submit">
> </form>
> 
> How would I get Perl to run that #ls command with the user's option
>  values (#ls -al) and display the end result of that command?
> Would it be something similar to
> `ls` $commd;
> How would I show the end result?

An example:

     $result = `ls $commd 2>&1`;

The '2>&1' part makes it capture also possible error messages in $result.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

0
Gunnar
10/1/2003 9:31:38 PM
Nick <kvetchv@yahoo.com> wrote:

> I am just starting out with Perl and am trying to figure out how to
> setup a CGI script 


You should learn Perl itself first, before moving on to a
complicated application area such as CGI programs.


> to perform some command line functions.  I work
> with some people that need to run some command line functions but we
> do not want to give them command line access.  


Why is it that you do not want to give them command line access?


> I thought that if I
> write a Perl CGI script that executes some of the commands for them,
> it would solve our problems.


It seems much more likely to me to _cause_ more problems
that it solves.

I think we have an XY problem.

If you can answer the question above, we will be in a much better
postion to give good advice...


> How would I get Perl to run that #ls command 



What is the "#ls" command?


> with the user's option


You better turn taint checking on (-T) and check the user's input
very very carefully. You have lots of chances of opening up a
security hole with your idea. Be careful.


> values (#ls -al) and display the end result of that command?
> Would it be something similar to 
> `ls` $commd;


Assuming that $commd has somehow gotten the corresponding value
from the form, hopefully by calling CGI::param():

   my $result = `ls $commd`;


> How would I show the end result?

   print $result;

If it is in a CGI program where the output is supposed to go
to STDOUT anyway, then you do not need to capture the output
at all:

   print "Content-type: text/plain\n\n";
   system "ls $commd";


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas
0
tadmc
10/1/2003 11:08:22 PM
Thanks guys.

tadmc@augustmail.com (Tad McClellan) wrote in message 
> You should learn Perl itself first, before moving on to a
> complicated application area such as CGI programs.

sounds like a fine idea and I intend to do this but I was hoping I
could pick up enough to write this CGI program
> 
> Why is it that you do not want to give them command line access?
> 
Our company has a policy that does not allow departments other than IT
to have command line access to the app servers.  Another department in
our company uses a program that makes additions/changes to one of our
app servers & database and the only current way to make these specific
changes is for them to put in a request with the IT department to
manually type in this application's script.
>
Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in message news:<blfh4d$bgeu8$1@ID-184292.news.uni-berlin.de>...
> *Some* of the commands? Do they have access to upload and run their
> own CGI scripts? In that case, what prevents them from uploading a
> script and executing *any* system command?
> 
Yes, they do have this control but since they are part of our company
we trust them and the app server and database is their equipment, we
just run/houses/configure so it is unlikely they will do harm to their
own machines
> 
> 
> An example:
> 
>      $result = `ls $commd 2>&1`;
> 
> The '2>&1' part makes it capture also possible error messages in $result.

Thanks!

Gregory Toomey <nospam@bigpond.com> wrote in message news:<1211198.pjaMW0z05n@gregs-web-hosting-and-pickle-farming>...
> It was a dark and stormy night, and Nick managed to scribble:
> 
Aaaaah, the story of my life.

Michael Budash <mbudash@sonic.net> wrote in message news:<mbudash-00DE11.14242401102003@typhoon.sonic.net>...

> the most naive way would be this:
> 
> #----------------------------------------
> #!perl -w
> 
> use strict;
> use CGI qw/:standard/;
> 
> $|++;
> 
> print header();
> 
> my $commd = param('commd');
> 
> print `ls $commd`;
> #----------------------------------------
> 
> however... think of what would happen if the user entered "; rm -fr *.*" 
> !!!!!!!
> 
> you might wanna constrain what is allowable...


We would restrict them to only certain commands.  While that doesn't
mean that they couldn't put a pipe in the options and enter a 2
commands at once but it is unlikely they would try to do any harm.
Thanks for the help!
0
kvetchv
10/2/2003 1:25:27 PM
On Thu, 2 Oct 2003, Nick wrote:

> sounds like a fine idea and I intend to do this but I was hoping I
> could pick up enough to write this CGI program

As others have already warned you in various ways: you seem to be
setting yourself up for a security compromise.

Don't misunderstand me: there's nothing wrong with playing around and
exploring the capabilities of your various tools, and everybody needs
to make a start somewhere;  but for a serious production application
you _do_ need a sound grasp of the components (Perl, CGI,
security...), and it seems to me that you are playing with fire if you
attempt it with less.  I'm not sure that I'd want to trust myself to
get that sort of thing right without some aggressive peer-review, and
I've been dealing with computers, off and on, since 1958.

It isn't a simple matter of "trusting" the users: maybe they hadn't
appreciated the consequences of their well-intentioned actions, but if
you haven't screened them effectively enough from the dangerous bits
them the result would be as bad, irrespective of their intentions in
the matter.  Isn't that why the company policy is to keep them away
from the command line in the first place, after all?
0
Alan
10/2/2003 2:53:36 PM
kvetchv@yahoo.com (Nick) writes:

> tadmc@augustmail.com (Tad McClellan) wrote in message 

> > Why is it that you do not want to give them command line access?
> > 
> Our company has a policy that does not allow departments other than IT
> to have command line access to the app servers.

This reminds me of something that I've heard of happening in a number
of places in one form or another.

The basic senario comes down to this.

Someone in a company decides that some resource needs to be protected
from the masses.  So the rooms containing that resource have their
locks changed.  The minions are not given keys to the rooms where the
valuable resource is housed.

However, in order to do their jobs the minions need to use the
resource.  The solution is to hang a key to the secure rooms in a
place where everyone (including visitors without even the minions'
keys) can get to it.  

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\
0
Brian
10/2/2003 4:50:59 PM
In article <3eb8c8ea.0310020525.374773b9@posting.google.com>,
	kvetchv@yahoo.com (Nick) writes:
> Thanks guys.
> 
> tadmc@augustmail.com (Tad McClellan) wrote in message 
>> You should learn Perl itself first, before moving on to a
>> complicated application area such as CGI programs.
> 
> sounds like a fine idea and I intend to do this but I was hoping I
> could pick up enough to write this CGI program

This can all be done, and has been done safely before, and even presented
in this forum before.  But the basics are:

By allowing an input field for a user to type into, you are subject to
stuff like this:

enter arguments to ls:  -l ; cat /etc/passwd

See what I mean?

The best way to do this is with a pull down list, checkboxes, or something
similar.  If you allow an input field, you have just allowed acces to the
system.  If the list of things that they need to do is larger than the
scope of a list, then you need to provide them an account.  At LEAST a 
web account that they must log in with before using your tool.  You would
also want your tool to log actions taken by userid.

Collecting process accounting for individual accounts is MUCH safer than
trying to figure out which IP was connected to the web server at the time
of the 'problem'.

Some years ago I did an application for the help desk that allowed them to
run common commands on any system in the data center by clicking on a web
page.  It was used for first level system check before escalation.  It
used secure shell from a trusted host, and some of the commands needed to
be run as root (vxdisk list, for example).  The only way that this can be
done safely, is to define a finite set of commands that they will use, and
build forms that allow options by selection ONLY.  Never an input field.

The cgi scripts that run these commands must have rigid checks of the fields
that they are passed.  Even though they were hard coded in the forms, users
could figure out which cgi scripts are being called and try to pass them
commands directly.

Hope this helps.
0
x0pmeyer
10/3/2003 8:36:45 AM
Phil Meyer wrote:

[snip]

> This can all be done, and has been done safely before, and even presented
> in this forum before.  But the basics are:
> 
> By allowing an input field for a user to type into, you are subject to
> stuff like this:
> 
> enter arguments to ls:  -l ; cat /etc/passwd
> 
> See what I mean?
> 
> The best way to do this is with a pull down list, checkboxes, or something
> similar.  If you allow an input field, you have just allowed acces to the
> system.  If the list of things that they need to do is larger than the
> scope of a list, then you need to provide them an account.  At LEAST a 
> web account that they must log in with before using your tool.  You would
> also want your tool to log actions taken by userid.

I have a question about whether an input field is any more secure than a 
pull-down list/checkbox. Even though the form is hard-coded can't 
aynyone submit pretty much anything they want, for example with LWP?

> Collecting process accounting for individual accounts is MUCH safer than
> trying to figure out which IP was connected to the web server at the time
> of the 'problem'.
> 
> Some years ago I did an application for the help desk that allowed them to
> run common commands on any system in the data center by clicking on a web
> page.  It was used for first level system check before escalation.  It
> used secure shell from a trusted host, and some of the commands needed to
> be run as root (vxdisk list, for example).  The only way that this can be
> done safely, is to define a finite set of commands that they will use, and
> build forms that allow options by selection ONLY.  Never an input field.
> 
> The cgi scripts that run these commands must have rigid checks of the fields
> that they are passed.  Even though they were hard coded in the forms, users
> could figure out which cgi scripts are being called and try to pass them
> commands directly.

This is more what I thought you are supposed to do with CGI - rigidly 
check all fields passed to the form - the person who builds the form 
specifies a set of *acceptable* parameters, and anything that does not 
fall in the defined set gets ignored, calls an error routine, etc. In 
other words, all form element are equally not secure.

Please correct me if I am making any incorrect assumptions.

thanks - keith

0
ko
10/3/2003 9:22:41 AM
On Fri, 3 Oct 2003, ko wrote:

> I have a question about whether an input field is any more secure than a
> pull-down list/checkbox.

I have an answer, and it would be on-topic for
comp.infosystems.www.authoring.cgi because there's nothing
Perl-specific in it...

> Even though the form is hard-coded can't
> aynyone submit pretty much anything they want, for example with LWP?

Correct.

[...]
> Please correct me if I am making any incorrect assumptions.

About the appropriate group to post to, see above.

About the topic, see Lincoln Stein's web security FAQ.

But basically, as to content you seem to be on the right lines.

0
Alan
10/3/2003 10:31:12 AM
Alan J. Flavell wrote:

> On Fri, 3 Oct 2003, ko wrote:
> 
> 
>>I have a question about whether an input field is any more secure than a
>>pull-down list/checkbox.
> 
> 
> I have an answer, and it would be on-topic for
> comp.infosystems.www.authoring.cgi because there's nothing
> Perl-specific in it...
> 

[snip]

> 
>>Please correct me if I am making any incorrect assumptions.
> 
> 
> About the appropriate group to post to, see above.
> 
> About the topic, see Lincoln Stein's web security FAQ.

Thanks for the advice, I've already read the FAQ. I guess my overly 
subtle (bad) attempt to give the OP a hint that he should check *all* 
form element parameters should have been posed as statements rather than 
questions.

And actually, a little over a year ago you were generous enough to help 
me when I was writing my "First CGI script". Although I admit at least I 
posted snippets of code :)

0
ko
10/3/2003 11:20:41 AM
ko <kuujinbo@hotmail.com> wrote in message news:<bljf8i$bg1$1@pin3.tky.plala.or.jp>...
> Phil Meyer wrote:
> 

> I have a question about whether an input field is any more secure than a 
> pull-down list/checkbox. Even though the form is hard-coded can't 
> aynyone submit pretty much anything they want, for example with LWP?
> 
> > Collecting process accounting for individual accounts is MUCH safer than
> > trying to figure out which IP was connected to the web server at the time
> > of the 'problem'.
> > 

(OT)

Linux has Webmin to do all that you are asking in its CGI 'shell'
feature:

http://www.webmin.com

--and I think that some of their code can be adapted to do what you
want.

However, this is not really Perl, and, I think allowing anyone out
there on the Web to use either Webmin or your equivalent of an
arbitrary command line is __very very__ unwise. IMHO, Webmin is best
confined _behind_ a firewall.
0
wherrera
10/3/2003 1:27:46 PM
Thanks for all your comments.  I will definitely look into all the
possibilities before I commit to anything, everyone has given me a lot
to look into.  Even though there will be someone that reviews and
corrects any flaws in my CGI script (that person just doesn't have the
time right now to write the script so I thought I would try it and
learn a little Perl in the meantime) I will study up on some Perl
before I attempt to jump into this.  A friend gave me a Perl book to
read, so I will study up on that and then come back with some more
questions.

Thanks,
Nick
0
kvetchv
10/3/2003 2:07:57 PM
Nick <kvetchv@yahoo.com> wrote:

> A friend gave me a Perl book to
> read


Which one?

There are lots of poor Perl books.

Tell us which one you have, and we'll tell you if it's good or not.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas
0
tadmc
10/3/2003 3:05:11 PM
Reply:
Similar Artilces:

find function with cells
Hi, i am trying to use the find function: x1=find(Cusips==UCusips(i)); well Cusips as well as UCusips consist of column of cells (their content is numbers and two letters). I received an error ?? Function 'eq' is not defined for values of class 'cell'. is their a way to overcome the problem? thx J Try, >> help isequal isequal is not helping.isequal(A,B) means If all the elements of a cell array or structure are numerically equal, isequal returns logical 1.First A and B in my case are not fully numerical (I have numbers and letters) and second A is different in many el...

perl: warning: Setting locale failed.
Hello! I am using Debian, my packages are mixed stable/testing, and when I update packages using KPackage I get lots of perl warnings: > perl: warning: Setting locale failed. > perl: warning: Please check that your locale settings: > LANGUAGE = (unset), > LC_ALL = "en_US", > LANG = (unset) > are supported and installed on your system. > perl: warning: Falling back to the standard locale ("C"). Lots of these, and sometimes these: > locale: Cannot set LC_CTYPE to default locale: No such file or directory > locale: Cannot set LC_MESSAGES ...

(650) US-CA-San Mateo: PeopleSoft Functional HRMS (39191)
********************************************************************** This job posting is brought to you by ISHUNTER.COM, offering computer jobs for programmers, engineers, systems analysts, network administrators and other high technology professionals. Search over 3,000 IS/IT jobs in the United States by clicking on http://www.ISHunter.com ********************************************************************** Title ...... PeopleSoft Functional HRMS Skills ..... HRMS 8x PeopleSoft Location ... San Mateo, CA Area Code .. 650 Term ....... Contract Length ..... 2 y...

bad command= option in ssh authorized_keys
Hi, After further trace the cause of the problem, I managed to get more detail about the failure of passwordless scp login. Please see below for more detail: # scp -v -p bookmarks.html toor@192.168.1.2:/usr/local/etc/ ..... ..... debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Next authentication method: publickey debug1: Trying private key: /root/.ssh/identity debug1: Offering public key: /root/.ssh/id_rsa debug1: Remote: Port forwarding disabled. debug1: Remote: X11 forwarding disabled. debug1: Remote: Agent forwarding disabled. debug1: Re...

MJD (of "Higher Order Perl") on Lisp macros
Copied from: http://lists.warhead.org.uk/pipermail/iwe/2005-July/000130.html (HOP itself has a very nice intro that refers to Lisp.) From: Mark Jason Dominus <mjd@plover.com> Date: Jul 28, 2005 11:16 PM Subject: Re: HOP -vs- SICP To: hop-discuss@plover.com Bennett Todd: > ... blinded by the superficial > ickiness of lisp (ref lwall "visual appeal of oatmeal with > fingernail clippings mixed in) As I think I said in the "Perl Review" interview, this is not just a matter of personal taste. Some people don't like Lisp syntax, but it has several major tech...

FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? #19
This is an excerpt from the latest version perlfaq1.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 1.4: What are Perl 4, Perl 5, or Perl 6? (contributed by brian d foy) In short, Perl 4 is the past, Perl 5 is the present, and Perl 6 is the future. The number after Perl (i.e. the 5 after Perl 5) is the m...

Optimisation of a function of discrete parameters
Hi I am trying to optimise a function that can only be evaluated for integer input parameters. Is it possible to do this? I tried to use the "bnb" mfile mentioned in previous posts but this begins by performing an optimisation using continuous parameter values. Are there any alternative approaches that do not require the use of continuous variables during the convergence? Any ideas would be greatly appreciated! Many thanks John Dear John, Do you only have a function? I assume the problem is nonlinear? If your problem is costly (few variables, up to 25), then you can try TOMLAB ...

POTENTIAL function is not so smart. Be careful!
THE PROBLEM ----------- Hello there. Well, I don't know if you all bealieve in what your calculator (HP49g+ in my case) tells you. But if you do, be careful. I am posting this message so other people can learn from my mistake. I wanted to find the potential function of this vector: F(x,y) = (2*x + y^2*sin(2*x), 2*y*sin(x)^2) Well, after writing this vector and giving the second argument correctly: 2: [ '2*x + y^2*sin(2*x)' '2*y*sin(x)^2' ] 1: [ 'X' 'Y' ] the calculator displays the following message "POTENTIAL Error: Bad Argument Value". Tryi...

Executing a script prior to sending a document with NCSA HTTPd 1.5.2a
Hi there. I have to maintain an old server based on NCSA HTTPD 1.5.2a; as it works accordingly to my customer's satisfaction, there is no point of changing for any other server as Apache. But I have to make the following improvement: before sending any document (HTML, PDF, or any format), I need to ensure that certain conditions are met, mainly by running a cgi to parse cookies. I searched the NCSA HTTPd documentation for several days without being able to find a solution. Has someone any idea to help me? Thanks. ...

Perl search engine
A new search engine through a perl-related websites is opened: http://brainworker.ru/en/ Hope it would be useful useful to somebody. >>>>> "�" == �� <mayweed@gmail.com> writes: �> A new search engine through a perl-related websites is opened: �> http://brainworker.ru/en/ Hope it would be useful useful to somebody. the irony is that this was posted via google! but i bet the spammer won't get the irony. uri -- Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Trai...

Command Line Life Partner Wanted
Now here is somebody in love with the shell and company: http://www.craigslist.org/about/best/nyc/485967082.htm Wallman http://www.3dwallpaper.ws ::: 3D wallpapers ::: On 2008-01-22, Wallman <info@3dwallpaper.ws> wrote: > Now here is somebody in love with the shell and company: > http://www.craigslist.org/about/best/nyc/485967082.htm > that's .html ...

STANDA MOTOR AND BUILDING AN EXECUTABLE APPLICATION
Hello, I have some problem to build a executable file from the main labview program. For other applications and devices i don't have any problems (i build executable files and use them on other computer without any problems). But with this stepper motor, the main program and the examples given by the comapany in Labview works and the executable files don't (By not working i have no particula error message but no remote control at all). Has someone met this problem? I think that there is something wrong during compilation (links are missing or something like that?) I would appreciate he...

FAQ 3.3 Is there a Perl shell? #14
This is an excerpt from the latest version perlfaq3.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 3.3: Is there a Perl shell? The psh (Perl sh) is currently at version 1.8. The Perl Shell is a shell that combines the interactive nature of a Unix shell with the power of Perl. The goal is a full featured shell...

Re: Combination of bar chart and line series chart #2
Hi...V9 has PROC GBARLINE...from on-line help... Overview The GBARLINE procedure produces bar line charts. Bar line charts are vertical bar charts with a plot overlay. These charts graphically represent the value of a statistic calculated for one or more variables in an input SAS data set. The charted variables can be either numeric or character. I'm not sure what they look like in Excel, but there's example code on the SAS web site for GBARLINE... http://support.sas.com/rnd/samples/graph/gbarline.html Mike Zdeb U@Albany School of Public Health 1 University Drive Rensselaer, NY ...

Two million error lines in .xsession-errors from KDE?
I noticed that my ~ .xsession-errors file had grown huge. It had over 2 million lines of messages like below. I use the gtk-engine-qt to make Synaptic and Jpilot look a bit better and I think maybe FireFox is having a problem with it? I know this is coming out of FireFox... but that's all I know. I truncated the file and it grew to 88K in a matter of minutes. For time being I symlinked it to /dev/null. I run KDE 3.4.1 with FireFox 1.0.6-2 on Kanotix. Anyone have any info on this problem? Thanks, Al Gecko:3547): Gdk-CRITICAL **: gdk_pixbuf_get_from_drawable: assertion...

Blank lines and paragraph break in html
Hi there, I have a quick question. In my html document, I want to make a new paragraph whenever I have a blank line in the html source. Using <p> and </p> every time is kind of cumbersome (I want to do it the LaTeX way). Is it possible at all? Thanks for your time, Yogi Yogi wrote: > I have a quick question. In my html document, I want to make a new > paragraph whenever I have a blank line in the html source. Using <p> > and </p> every time is kind of cumbersome (I want to do it the LaTeX > way). Is it possible at all? <p> is the...

Please help on the error related to symbolic function
Hi, I have the following code with symbolic math to call the golden section search method. (I feel very sorry that it is very long!) ----------------------------------------------------------- ......... foca=sym('foca'); focal = foca(ones(size(leftFeatures, 1),1)); newLeftFeatures = [leftFeatures(:, 1:2), focal]; newRightFeatures = [rightFeatures(:, 1:2), focal]; normLeftFeatures = sqrt(sum(newLeftFeatures(:,1:3).^2, 2)); normRightFeatures = sqrt(sum(newRightFeatures(:,1:3).^2, 2)); accumLeft = sym(zeros(sum(1:size(leftFeatures, 1) -1), 1)); accumRight = sym(zeros(sum(1:size(leftFeatu...

Tracking the status of python script execution
--90e6ba614b2ae5396b04ed4733e4 Content-Type: text/plain; charset=ISO-8859-1 Hello All, I am looking for a library that can help me trace the status of a live python script execution. i.e if I have a python script `x.py` with 200 lines, when I execute the script with `python x.py`, is there a way to trace the status of this execution in terms of number of lines executed so far? Background: We have a Web page with "Run" button that executes the program `x.py` when a user clicks it. We were looking of a way to keep the user informed about the status of run by using: (no....

Sysread in perl
Hi, I am trying to read the last 500 bytes of a file. I'm trying to use sysread command, I have read the docs for it on cpan and it seems the right thing to use. My only problem is when i spcify a negative offset it fails with the following error "Offset outside string at test.pl line 30.". here is the line it is complaing about sysread(F,$string,500,-500); I have tried escaping the minus sign , putting it into a var and using eval and they all come back with the same error. Heres the paragraph from cpans docs "An OFFSET may be specified to place the read d...

Geodetic functions library GeoDLL 32 Bit and 64 Bit #2
Hi developers, who develops programs with geodetic functionality like world-wide coordinat= e transformations or distance calculations, can use geodetic functions of m= y GeoDLL. The Dynamic Link Library can easily be used with most of the mode= rn programming languages like C, C++, C#, Basic, Delphi, Pascal, Java, Fort= ran, Visual-Objects and others to add geodetic functionality to own applica= tions. For many programming languages =E2=80=8Bappropriate Interfaces are a= vailable. GeoDLL supports 2D and 3D coordinate transformation, geodetic datum shift a= nd reference system con...

Making an executable file from a program
Can any one suggest how to make a .exe file from any (fully compiled error free)executable program? Thanks in advance Sowrabh said: > Can any one suggest how to make a .exe file from any (fully > compiled error free)executable program? That's like asking how to make soup from soup. A properly constructed .exe file (on a Windows or MS-DOS or CP/M machine) /is/ an executable program. -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ Google users: <http://www.cpax.org.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 ...

Is there a unix command to display unix user account expiry, inactive expiry
Dear Unix Gurus, 1. Is there a Solaris command to display configured unix user account expiry days i.e let's say I execute %unix usermod -e 06/11/2004 jk1 How can I see this date using a unix command ? and similarly for inactive expiry days. I tried using passwd -s jk1 but that displays only Passoword information only. 2. Is there a Solaris API to convert expiry date in /etc/shadow to mm/dd/yy format and vice-versa ?ie. jk1:2j92MGiE0iljY:12577:7:30:7::12580: <--How can I convert 12580 to 06/11/2004? Any help/pointers will be highly appreciated. Thanks a ton in advance. Jitendra ...

Extra new line inserted in simple program
Hi all Please forgive me for the simplistic and inefficient nature of the following program - I am working through the early chapters of a "Teach yourself Perl" book. Could someone tell me why Program 1 leaves a gap between the first and second lines of the descending list of numbers that it outputs, which is in contrast to Program 2 which prints a continuous list? I'd be very greatful for your explanation Many thanks Paul = = = = = = = Program 1 = = = = = = = #!/bin/perl print ("Enter a number\n"); $number = <STDIN>; print ("\n\n\n"); $count = ...

Class with functions that return STL containers with incomplete types
Greetings, Having classes with member objects that have STL containers of objects whose definitions are incomplete results in undefined behavior. See for example: http://www.ddj.com/database/184403814#8 http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.14 I am wondering: is it okay to have member functions that return an STL container with an incomplete type? My member objects do not contain incomplete types. For instance, would the following code be OK? Thanks. --Omari #include <boost/shared_ptr.hpp> #include <vector> class HasSelf { public: HasSelf(...

Re: SAS w/ PERL #4
Can't be too difficult. After all, David Cassell become a perl expert, and he was a statistician! ;> S -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of John Burton Sent: Monday, June 08, 2009 4:49 PM To: SAS-L@LISTSERV.UGA.EDU Subject: SAS w/ PERL Hi all, I've been contatced about an opportunity using both SAS and PERL. I have tons of SAS, but no PERL experience. How hard is PERL to pick up on the fly? Should not having it be a deal-breaker? -- Best Cheers, Ray Burton Chattanooga TN AnalyticBridge, Linked-In, MedZilla, SAS/L ...