LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-03-2003, 05:24 AM   #1
WiZaC
Member
 
Registered: Sep 2003
Location: Denmark
Distribution: FreeBSD
Posts: 110

Rep: Reputation: 15
exec, a file or something.. how..?


How can I make a script, then if I push on a link on a website, then it will start a program (./filname) in my freebsd 4.8 system ( http://sysinfo.wizac.net )?? Please help!

WiZaC
 
Old 10-03-2003, 08:49 AM   #2
lackluster
Member
 
Registered: Apr 2002
Location: D.C - USA
Distribution: slackware-current
Posts: 488

Rep: Reputation: 30
hack the webrowser?

or, if you own the link, you can change the mime type and setup a handler for that ... uh something about /etc/mailcap ... yeah ... stuff

good luck
 
Old 10-03-2003, 10:49 AM   #3
WiZaC
Member
 
Registered: Sep 2003
Location: Denmark
Distribution: FreeBSD
Posts: 110

Original Poster
Rep: Reputation: 15
I dont know, what you are mean? explain, please!

WiZaC
 
Old 10-03-2003, 11:10 AM   #4
jinksys
Member
 
Registered: Aug 2003
Location: 63123
Distribution: OpenSuSE/Ubuntu
Posts: 419

Rep: Reputation: 35
If you are able to use PHP, this link may be of service:
http://www.phpfreaks.com/phpmanual/p...tion.exec.html
 
Old 10-03-2003, 12:42 PM   #5
Sm0k3
Member
 
Registered: Sep 2003
Location: Chicago
Distribution: Slackware-current
Posts: 63

Rep: Reputation: 15
k, i'll try to explain this best as possible..

i don't know much about PHP, that would probly be a better alternitive than to this.

anyway, you will need cgi access (e.g. write access to /wherever/your/documentroot/is/cgi-bin)

in this example we will create a script in cgi-bin called 'mycommand'

Code:
#!/bin/sh

echo "executing stuff..."

exec /path/to/whatever
then on the webpage

Code:
<a href=http://yourwebsite.com/cgi-bin/mycommand>clicking here will execute your command</a>
this is a workaround, there is alot to cgi, but like i said you'd probly be better off using PHP

Last edited by Sm0k3; 10-03-2003 at 12:43 PM.
 
Old 10-03-2003, 08:37 PM   #6
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
PHP Code:
<?php
// Sample implementation to see system information in PHP
echo "OS and Hardware Info:<br />";
echo 
"<pre>";
passthru("procinfo");
echo 
"</pre><br />";
echo 
"Processor Info:<br /><pre>";
passthru("cat /proc/cpuinfo");
echo 
"</pre>";
?>
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc: installation problem, cannot exec `cc1': No such file or directory Error Message 08h Programming 2 07-20-2006 11:44 AM
find /folder/* -exec ./file '{}' -nohomedir \; ??? utw-mephisto Linux - General 2 05-10-2005 08:09 AM
"How to execute .exec file in linux?" ponnusamy Linux - Networking 3 01-12-2005 02:19 AM
gcc: installation problem, cannot exec `cc1': No such file or directory natsirc Linux - General 3 11-11-2004 09:26 AM
gcc: installation problem, cannot exec `cc1': No such file or directory Error Message 08h Linux - Newbie 1 06-01-2004 04:26 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration