hello all,
I'm invoking the program generate-report using backticks from my perl program and redirecting the output to the log file sge-stderr.log. But when i check the process using ps command it is spawing two processes where the below code is parent process and the program generate-report as... (2 Replies)
I'm writing a script using file descriptor 2 (std error) to send an email only if the command fails or errors out but the script always emails me irrepective of whether it fails or not. It will not email the /tmp/check.error file output if doesn't error out just the mail with the subject "Cannot... (3 Replies)
I currently have an expect script that issues the 'mail' command and sends an 'x' when it receives the & prompt from mail to quit.
The expect script is able to do stty rows 100 columns 200 < $spawn_out(slave,name) to set up the number of columns and rows.
I would like to get rid of the expect... (0 Replies)
hi,
i wat to get the output of a grep command in a file. but when i am trying out the same grep command in the unix prompt its working fine.. i am getting the output properly.. but when i am writing the same command inside my shell script , its just creating a new output file with no contents... (11 Replies)
Hi,
I'd like to redirect the STDOUT output from my script to a file and simultaneously display it at a console.
I've tried this command:
myscript.sh | tail -f
However, it doesn't end after the script finishes running
I've also tried this:
myscript.sh | tee ~/results.txt
But it writes... (3 Replies)
hi,
i have a html form which call a perl program, this perl program calls a shell script.
<html>
<head>
<title>demo</title>
</head>
<body>
<form name="frm1" action="/cgi-bin/perl_script.pl" method="post">
<input type="text" name="fname">
... (1 Reply)
Hi Guys,
I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts.
I used below but it is not working:
OFILE=/home/home1/report1
echo "report1 details" > $OFILE
=/home/home1/1.sh > $OFILE
echo... (7 Replies)
I have the below script, but when i execute it is still printing to screen is there a way i can stop this and just print everything to the log file. Thank you.
#!/bin/bash
exec > >(tee "/var/log/ScriptLogs/called_from_incrontab.log") 2>&1
DIR="$1"
FILE="$2"
echo "STEP 1: Datafile... (5 Replies)
i have simple program that generate log file 1 line every sec, i need to do grep for specific record then redirect to another file.
#!/bin/bash
for i in `seq 1 20`;
do
echo $i
sleep 1
done
./test.sh |egrep "5|10|15"
5
10
15
r
./test.sh... (2 Replies)
Hi Experts,
Could you pls help with below query
I have written below script to capture disk utilization and then send the output on mail. But getting unformated output on mail
#!/bin/bash
echo "Hi Sur,">dfoutput.csv
printf '\n' >>dfoutput.csv
echo "Please find BAYSQUAR2 filesystem... (4 Replies)
Discussion started by: as7951
4 Replies
LEARN ABOUT OSF1
cfg_subsys_state
cfg_subsys_state(3) Library Functions Manual cfg_subsys_state(3)NAME
cfg_subsys_state - Determine the state of the named subsystem
LIBRARY
Configuration Management Library (libcfg.a)
SYNOPSIS
#include <cfg.h> cfg_status_t cfg_subsys_state(
cfg_handle_t *handle,
caddr_t subsys,
unsigned int *state);
PARAMETERS
Structure identifying the means of communication between your application and the configuration management server. For local requests,
pass NULL in this parameter. For remote requests, pass the value you receive when you call the cfg_connect() routine. Specifies the name
of the subsystem for which you are requesting state information. Returns a collection of bit flags representing the state of the subsys-
tem. The bit flags are defined in the <sys/sysconfig.h> header file. The following flags are currently defined: CFG_STATE_CONFIGURED,
CFG_STATE_DYNAMIC, and CFG_STATE_LOADED.
DESCRIPTION
Use the cfg_subsys_state() routine to determine the state of a particular subsystem. Subsystems can be loaded, loaded and configured, or
unloaded. (Subsystems must be loaded to be configured.) In addition, a subsystem can be either static (the CFG_STATE_DYNAMIC bit flag is
not set) or dynamic (the CFG_STATE_DYNAMIC bit flag is set). Static subsystems are linked into the kernel at build time and the only way
to add or remove them from the kernel is to rebuild the kernel. Dynamic subsystems are loadable, meaning that they can be added and
removed from the kernel while the system is running.
The value returned in the state parameter is an integer representation of a binary value. The bits in the value designate the state of the
subsystem. For example, the least significant bit designates whether or not the subsystem is loaded. If this bit is set, the subsystem is
loaded. If the next higher order bit is set, the subsystem is configured. You can determine the state of a subsystem by using the value
returned in the state parameter in a bitwise AND operation. The <sys/sysconfig.h> header file defines constants for this purpose. See the
EXAMPLES section for more information about using these constants.
EXAMPLES
The following example illustrates the use of the cfg_subsys_state() library routine:
cfg_status_t retval; cfg_handle_t handle; unsigned int state;
retval = cfg_subsys_state(&handle, "vfs", &state);
if (retval != CFG_SUCCESS)
print_error(retval); else {
/* Determine whether or not the subsystem is loaded */
/* and configured. Display a message describing the */
/* subsystem state. */
if (state & CFG_STATE_LOADED) {
if (state & CFG_STATE_CONFIGURED)
printf("The subsystem is loaded and configured.
");
else
printf("The subsystem is loaded but not configured.
");
else
printf("The subsystem is unloaded.
");
} }
In this example, the cfg_subsys_state() routine returns a value representing the state of the vfs subsystem. The application determines
whether the call to the routine was successful and, if it was, displays a message describing the state of the subsystem.
RETURN VALUES
Upon successful completion, cfg_subsys_state() returns CFG_SUCCESS. Other return values indicate that an error has occurred. For informa-
tion about handling return values from routines in the configuration management library, see libcfg(3).
RELATED INFORMATION
Commands: cfgmgr(8), sysconfig(8)
Routines: cfg_subsys_list(3), libcfg(3) delim off
cfg_subsys_state(3)