![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to write script in tar | naveeng.81 | Shell Programming and Scripting | 1 | 04-18-2008 01:04 PM |
| Please write this script for me | nadman123 | Shell Programming and Scripting | 1 | 04-08-2008 11:30 PM |
| Help me to write the script | gyana_cboy | Shell Programming and Scripting | 5 | 10-05-2007 03:19 AM |
| How to write script for this ? | me_haroon | AIX | 0 | 07-01-2006 07:30 AM |
| need help to write shell script | getdpg | Shell Programming and Scripting | 0 | 04-10-2006 11:30 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Help! Need to write my first script
Hi Folks!
I am a MacUser and am trying to learn Unix for the last few months. I will explain in detail what I am trying to do, and apreciate you help if you can teach me even if it is a single comand line inside the script. I own a small company, where I manufacture special gypsums and plasters for dental use. Outside my office, I have a equipment, a scale, that can weigh pallets from 0 to 3000Kg. This scale is connected to my small network and has its own web server. If I type on this URL: http://169.254.79.250/peso.html on any web browser, on any computer, on my small network, a request is sent to the webserver installed on my scale and a page as this is displayed: example in .html: Click here for example. (this example contains a Javascript that will direct you to an error page after a few seconds. You might need to click on the "back" button of your browser) example of the source code in pdf: click here for example in pdf One can notice inside the code where it is written "0,0Kg". This is the variable. As one of my employees places a new pallet with a diferent new weight this value changes. OK! This is what I want to do: I want to write a script to run on the Macs's Unix terminal and do this: 1) Capture the html source code on http://169.254.79.250/peso.html (this is a reference in my small network) 2) Identify the variable inside the code, let's say each 10 seconds. (the value just before Kg) 3) Use a logical function to determine if the value has changed, and if it did change , write a line in a text file. (pesolog.txt) Example of pesolog.txt: O January 2nd 2004 at 12:45 peso has changed to 1254Kg On January 2nd 2004 at 13:15 peso has changed to 1869kg etc... I thank you for your help, even if it is just a single command line. Greeting from Bernardo Höhl Rio de Janeiro - Brazil PS: This site is so CPU intensive on my Mac. My computer runs very, very slow when I have this page running.. Do you experience the same problem? |
|
||||
|
Re: Help! Need to write my first script
Quote:
|
|
||||
|
Dear Lazzar,
We have to keep in mind that we need to capture code from a WebServer that has no hardisk or I have access to changing the way it works. Let's assume that whatever I build, I will build on my computer. Question 1) Can Javascript capture code on the remote WebServer and write it on my harddisk? Question 2) Can PHP do just the same? Could you give an example of how it can be done? Thanks for your comments! Bernardo Höhl |
|
||||
|
Hi folks!
I have been able to display the souce code by typing the following: telnet 169.254.79.250 80 GET /MostraPeso.shtm HTTP/1.0 User-Agent: Mozilla/1.1N (Macintosh; I; 68K) Accept: */* It works. I get the source code displayed on my terminal. But when I write the shell script with these comands, only the first comand is executed. The next lines are only executed once the conection has been closed. I think some lines are missing on the shell script to make it executable within the conection. Please help! Thanks! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|