FreeBSD/sbin/ddb/ddb_script.c
/*
 * "ddb script" can be used to either print or set a script.
 */
"ddb script" can be used to either print or set a script.
" ddb script " can be used to either print or set a script .
void
ddb_script(int argc, char *argv[])
{
	if (argc != 2)
		usage();
	argv++;
	argc--;
	if (strchr(argv[0], '=') != 0) {
		if (sysctlbyname(SYSCTL_SCRIPT, NULL, NULL, argv[0],
		    strlen(argv[0]) + 1) < 0)
			err(EX_OSERR, "sysctl: %s", SYSCTL_SCRIPTS);
	} else
		ddb_list_scripts(argv[0]);
}
void ddb_script ( int argc , char * argv [ ] ) { if ( argc != 2 ) usage ( ) ; argv ++ ; argc -- ; if ( strchr ( argv [ 0 ] , ' ' ) != 0 ) { if ( sysctlbyname ( SYSCTL_SCRIPT , NULL , NULL , argv [ 0 ] , strlen ( argv [ 0 ] ) + 1 ) < 0 ) err ( EX_OSERR , " " , SYSCTL_SCRIPTS ) ; } else ddb_list_scripts ( argv [ 0 ] ) ; }
"ddb script" can be used to either print or set a script.
" ddb script " can be used to either print or set a script .