Dbrun()

From Recital Documentation Wiki
Jump to: navigation, search

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()