Sponsored Content
Top Forums Shell Programming and Scripting Redirecting output that was redirected to variable and console Post 302372213 by aigles on Tuesday 17th of November 2009 10:30:38 AM
Old 11-17-2009
A possible technique :
Code:
if display required
then
   Console=/dev/tty
else
   Console=/dev/null
fi

var=$(command | tee $Console)

Jean-Pierre.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Standard output not redirected from /bin/sh

I have an application which has a lot of cout & cerr statements. This application also opens a log file (for eg a.log). When this application is run from the inittab file as follows /bin/sh -c " . /etc/timezone; exec /test" all the cout & cerr statements are printed in the log file... (1 Reply)
Discussion started by: soorajmu
1 Replies

2. Shell Programming and Scripting

redirected output

Hello Everyone, I have an option for users in my shell script to create log file. So if user saying “yes” on it, I'm redirecting all output to log file by doing this: > /output.log. However I would like the output being displayed on the screen at the same time. Is it possible? If yes, does anybody... (2 Replies)
Discussion started by: slavam
2 Replies

3. UNIX for Dummies Questions & Answers

redirected output not going to file for all cases

I have to confirm that an engine was not able to run. In the output below you see that it indeed got errors, but it didn't send those messages to the output file. When I run the same thing with a different executable it works. So does this mean something in the executable could cause it not to... (7 Replies)
Discussion started by: brdholman
7 Replies

4. Shell Programming and Scripting

problem redirecting output of command to variable

Hi. I'm a newbie in scripting and i have this problem: i want to use the 'fuser' command on a file to tell if it's being accessed (for my purposes: still being written). I want to save the output of the command and later compare with the 'not being used' result. the script: #!/bin/bash... (2 Replies)
Discussion started by: nunovc
2 Replies

5. Shell Programming and Scripting

Exclude Certain Entries from Piped or Redirected Output?

I want to execute a command something like: find / -name "jni.h" and I want to direct the output of that command to some type of filter that will leave out all the lines reporting inaccessible directories (permission unavailable). Is this a pipe or a redirect? For example, output like... (1 Reply)
Discussion started by: downplay
1 Replies

6. Shell Programming and Scripting

Redirecting output to both console and to a file

Hi All, Is there a way in Bash we can redirection some output to both console and the file at the same time. ~Parag (2 Replies)
Discussion started by: paragkalra
2 Replies

7. UNIX and Linux Applications

missing delimiters when mysql output is redirected to log file

Hi, Pls check that '|' and '+' present in Step-1 are not copied to log file in Step-3. Pls suggest how to get the exact output from Step-1 (i.e. with out losing '|' and '+') in to a log file ~Thanks Step-1: Execute command > mysql -utest -ptest -htesthost testdb -e "select * from... (3 Replies)
Discussion started by: newbielgn
3 Replies

8. UNIX for Dummies Questions & Answers

Dot and redirected output syntax in a tar command

Hi All, Please could anyone advise what the purpose of the dot syntax in the following command means: tar -cvf ${WORKING_BACKUP_ROOT}/${TAR_ARCHIVE_FILE} . >/${BACKUP_ROOT}/${ARCHIVE_LOG} Many thanks (2 Replies)
Discussion started by: daveu7
2 Replies

9. Solaris

Redirecting console output to ILOM during installation

Hi, I need to install solaris remotely via the ILOM port on a x4170 box, and I have downloaded the Solaris 11 for x86 - text install image and burned it on a DVD. When I boot the box, it's showing the boot_archive loading percentage on the SP console, but when it's done and start the interactive... (0 Replies)
Discussion started by: u_paludan
0 Replies

10. Linux

RHEL 6.3 - chage command not redirecting the output to console.

When i am issuing chage command, it reporting the output properly. But when i redirect the output, i am not getting the output in the mentioned path. chage -l root >> /tmp/chage.txt. I need to use this into the script to capture the data. I think its seems to be bug with RHEL 6.3. Same... (3 Replies)
Discussion started by: Srini.rk1983
3 Replies
init.wbem(1M)						  System Administration Commands					     init.wbem(1M)

NAME
init.wbem - start and stop the CIM Boot Manager SYNOPSIS
/etc/init.d/init.wbem start | stop | status DESCRIPTION
The init.wbem utility is run automatically during installation and each time the system is rebooted. This utility manipulates the CIM Object Manager (CIMOM) and the Solaris Management Console server, both of which run combined in a single process. init.wbem can be used to start, stop, or retrieve status from the server. CIM Object Manager The CIM Object Manager manages CIM objects on a WBEM-enabled system. A CIM object is a computer representation, or model, of a managed resource, such as a printer, disk drive, or CPU. CIM objects are stored internally as Java classes. When a WBEM client application accesses information about a CIM object, the CIM Object Manager contacts either the appropriate provider for that object or the CIM Object Manager Repository. Providers are classes that communicate with managed objects to access data. When a WBEM client application requests data from a managed resource that is not available from the CIM Object Manager Repository, the CIM Object Manager forwards the request to the provider for that managed resource. The provider dynamically retrieves the information. At startup, the CIM Object Manager performs the following functions: o Listens for RMI connections on RMI port 5987 and for XML/HTTP connections on HTTP port 5988. o Sets up a connection to the CIM Object Manager Repository. o Waits for incoming requests. During normal operations, the CIM Object Manager performs the following functions: o Performs security checks to authenticate user login and authorization to access namespaces. o Performs syntactical and semantic checking of CIM data operations to ensure that they comply with the latest CIM Specification. o Routes requests to the appropriate provider or to the CIM Object Manager Repository. o Delivers data from providers and from the CIM Object Manager Repository to WBEM client applications. A WBEM client application contacts the CIM Object Manager to establish a connection when it needs to perform WBEM operations, such as cre- ating a CIM class or updating a CIM instance. When a WBEM client application connects to a CIM Object Manager, it gets a reference to the CIM Object Manager, which it then uses to request services and operations. Solaris Management Console Server The Solaris Management Console server is the back end to the front end console, smc(1M). It provides tools for the console to download and performs common services for the console and its tools to use, such as authentication, authorization, logging, messaging, and persistence. System Booting The init.wbem script is installed in the /etc/init.d directory. OPTIONS
The following options are supported: start Starts the CIMOM and Solaris Management Console server on the local host. stop Stops the CIMOM and Solaris Management Console server on the local host. status Gets the status of the CIMOM and Solaris Management Console server on the local host. NOTES
When the init.wbem script is run, it does not run the CIMOM and Solaris Management Console server directly. The server process is in Java and is too heavyweight to be run immediately at system boot time. Instead, three lightweight processes listen on three different ports that the CIMOM and the Solaris Management Console server normally use. This acts similarly to inetd(1M). Because Java programs cannot inherit file descriptors as other programs can, there is a small time period from when the first connection is made until the server is fully operational where client connections may be dropped. WBEM clients are immune to this, as they will retry until the server comes online. Solaris Management Console clients are not immune, and it may be necessary to manually reconnect, though this should not happen in the common case. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWwbcor | +-----------------------------+-----------------------------+ SEE ALSO
inetd(1M), mofcomp(1M), smc(1M), smcconf(1M), wbemadmin(1M), wbemlogviewer(1M), attributes(5) SunOS 5.10 2 Jan 2002 init.wbem(1M)
All times are GMT -4. The time now is 08:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy