Difference between revisions of "Dbrun()"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
(One intermediate revision by one user not shown)
Line 12: Line 12:
  
 
<input parameters>
 
<input parameters>
char *command; /* Address of a buffer containing an  
+
char *command; /* Address of a buffer containing an operating system command */
operating system command */
+
  
 
<output Parameters>
 
<output Parameters>
Line 42: Line 41:
 
rc = dbrun("rm *.bak");
 
rc = dbrun("rm *.bak");
 
if (rc != SUCCESS){
 
if (rc != SUCCESS){
printf("error no %dn", rc);
+
printf("error no %d\n", rc);
 
exit(1);
 
exit(1);
 
}
 
}
Line 55: Line 54:
 
rc = dbrun("purge/log");
 
rc = dbrun("purge/log");
 
if (rc != SUCCESS){
 
if (rc != SUCCESS){
printf("error no %dn", rc);
+
printf("error no %d\n", rc);
 
exit(1);
 
exit(1);
 
}
 
}

Latest revision as of 14:49, 1 May 2009

PURPOSE

execute an operating system command


SYNOPSIS

#include <dbl.h
 
	int	dbrun(command)
 
	<input parameters>
	char	*command;	/* Address of a buffer containing an operating system command */
 
	<output Parameters>
	none


RETURN VALUE

The dbrun() function returns 0 for success or < 0 if an error occurs. See the section on return code values for a detailed list of return codes.


DESCRIPTION

The dbrun() function executes an operating system command. Any valid operating system command can be specified.


EXAMPLE

The first example runs the UNIX "rm" command.

#include "dbl.h"
 
	int	rc;	/* Return code */
 
	rc = dbrun("rm *.bak");
	if (rc != SUCCESS){
		printf("error no %d\n", rc);
		exit(1);
	}
 
The second example runs the OpenVMS "purge" command.
 
<code lang="c">
#include "dbl.h"
 
	int	rc;	/* Return code */
 
	rc = dbrun("purge/log");
	if (rc != SUCCESS){
		printf("error no %d\n", rc);
		exit(1);
	}


SEE ALSO

dbdo()