9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Experts,
I am checking how to get day in Perl.
If it is “Monday” I need to process…below is the pseudo code.
Can you please prove the code for below condition.
if (today=="Monday" )
{
while (current_time LESS THAN 9:01 AM)
... (1 Reply)
Discussion started by: ajaypatil_am
1 Replies
2. Shell Programming and Scripting
Dear,
I want to check if the file in the if code is there, but I don't know how to do it?
if
Can someone assist me please?
Thanks!
kopie()
{
echo " Geef de naam van bestand + plaats vanwaar gekopieerd moet worden en waarnaar : "
echo -n " Plaats : "
read plaats
... (7 Replies)
Discussion started by: yadeki
7 Replies
3. UNIX for Advanced & Expert Users
Advance Thanks.
(1) I would like to know any unix/Linux command to check EOF char in a file.
(2) Or Any way I can check a file has been reached completely at machine B from machine A. Note that machine A ftp/scp the file to machine B at unknown time. (5 Replies)
Discussion started by: alexalex1
5 Replies
4. Shell Programming and Scripting
Hi,
I am a unix newbie. I need to write a script to check wheteher another script is still running. If it is, then sleep for 30m and then check again if the script is running. If the script has stopped running then, I need to come out of the loop.
I am using RHEL 5.2 (2 Replies)
Discussion started by: mathews
2 Replies
5. Shell Programming and Scripting
Can i write the following script...
$sqlplus -s uname/password @connectingstring
select emp_id,emp_name from employees > a.csv
quit
$mailx -s fga@ds.com < a.csv
$ (2 Replies)
Discussion started by: anupdas
2 Replies
6. Shell Programming and Scripting
I must write a script to change all C++ like comments:
// this is a comment
to this one
/* this is a comment */
How to do it by sed? With file:
#include <cstdio>
using namespace std; //one
// two
int main() {
printf("Example"); // three
}//four
the result should be: (2 Replies)
Discussion started by: black_hawk
2 Replies
7. Shell Programming and Scripting
HI all,
I need help in writing a shell script for the following logic
I have a file abc.txt and it contains a number x. The number in the file abc.txt changes every day. I need to develop a shell script which on every run checks the number in the file and increments a variable by 1 if a... (4 Replies)
Discussion started by: marcus_kosaman
4 Replies
8. UNIX for Dummies Questions & Answers
hello
is there any tool in unix that will indicate if some ip is already taken by other machine? (4 Replies)
Discussion started by: umen
4 Replies
9. UNIX for Dummies Questions & Answers
I wish to seach a Dir for a specific file, once the file is found i will perform additional logic. If the file is not found within two hours, i would like to exit.
Logically, I'm looking for the best way to approach this
Thanks for any assistance in advance.
Note: I'm using a C shell and... (2 Replies)
Discussion started by: mmarsh
2 Replies
WIN32_START_SERVICE_CTRL_DISPATCHER(3) 1 WIN32_START_SERVICE_CTRL_DISPATCHER(3)
win32_start_service_ctrl_dispatcher - Registers the script with the SCM, so that it can act as the service with the given name
SYNOPSIS
mixed win32_start_service_ctrl_dispatcher (string $name)
DESCRIPTION
When launched via the Service Control Manager, a service process is required to "check-in" with it to establish service monitoring and
communication facilities. This function performs the check-in by spawning a thread to handle the lower-level communication with the service
control manager.
Once started, the service process should do 2 things. The first is to tell the Service Control Manager that the service is running. This
is achieved by calling win32_set_service_status(3) with the WIN32_SERVICE_RUNNING constant. If you need to perform some lengthy process
before the service is actually running, then you can use the WIN32_SERVICE_START_PENDING constant. The second is to continue to check-in
with the service control manager so that it can determine if it should terminate. This is achieved by periodically calling
win32_get_last_control_message(3) and handling the return code appropriately.
PARAMETERS
o $name
- The short-name of the service, as registered by win32_create_service(3).
RETURN VALUES
Returns TRUE on success, FALSE if there is a problem with the parameters or a Win32 Error Code on failure.
EXAMPLES
Example #1
A win32_start_service_ctrl_dispatcher(3) example
Check if the service is runnig under the SCM.
<?php
if (!win32_start_service_ctrl_dispatcher('dummyphp')) {
die("I'm probably not running under the service control manager");
}
win32_set_service_status(WIN32_SERVICE_START_PENDING);
// Some lengthy process to get this service up and running.
win32_set_service_status(WIN32_SERVICE_RUNNING);
while (WIN32_SERVICE_CONTROL_STOP != win32_get_last_control_message()) {
# do some work here, trying not to take more than around 30 seconds
# before coming back into the loop again
}
?>
SEE ALSO
win32_set_service_status(3), win32_get_last_control_message(3), Win32 Error Codes.
PHP Documentation Group WIN32_START_SERVICE_CTRL_DISPATCHER(3)