06-05-2008
I figured out the answer my self, We can redirect the Message at "else " part using print"***Message***" >"&2"
at
awk' ....
If (){
}
else{
print"***Message***" >"&2"
} '
Simple
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am trying to use SCCS for project development . Can any one list out the basic setup nneded to be done for SCCS .
I mean if I create a SCCS directory what all files to create on this .
i don't have a root password of the system and I am not going to get one .
I saw few post on this forum... (1 Reply)
Discussion started by: akrathi
1 Replies
2. Shell Programming and Scripting
Hello gurus,
I am facing an unusual problem while running nohup in shell scripts.
i want to run two scripts simultaneously.In first script ,i take a backup of "nohup.out" & remove it .In second script,i state "nohup ./scriptname"
but "nohup.out" is not getting generated ??
pls find attached... (1 Reply)
Discussion started by: abhijeetkul
1 Replies
3. Shell Programming and Scripting
hi all,
This is a very basic question. I want to make the command work at all times.
i'm working on Suse-Linux and "clear" command is used to clear the contents of screen. I want to use only "cls" instead of "clear" command.
i tried alias cls=clear , but its working only for a temporary... (3 Replies)
Discussion started by: wxwidgets
3 Replies
4. Shell Programming and Scripting
Dear All,
I want acces my folder that name Log , that throught /export/home/hmi/bin/log.
I want direct to Log folder.
When I try using alias, i'm login as root:
>alias logfile='cd /export/home/hmi/bin/Log'
and when I execute
> logfile
this is work,
but after I logout and login again as... (3 Replies)
Discussion started by: heru_90
3 Replies
5. Solaris
Hi,
I used exceed and putty in the past to HP server with no problem to make
'set DISPLAY' work on my desktop. However now I have Solaris 9 on Sun server 480 and I only have putty. I can't bring the X window (eg xclock, etc) to my desktop.
I tried X11Fowarding, xhost, and so on, it doesn't... (5 Replies)
Discussion started by: jr_zhang
5 Replies
6. UNIX for Dummies Questions & Answers
hi
I wrote the following makefile, I have just one problem, when i type make clean I get the message make 'clean' is up to date and any obj file is removed from my folder, what's wrong?
Thank you
CC = cc
all: es.o elaboration.o
$(CC) -o es es.o elaboration.o
elaboration.o:... (0 Replies)
Discussion started by: Puntino
0 Replies
7. Shell Programming and Scripting
hii everyone ,
i have a file in which i have line numbers.. file name is file1.txt
aa bb cc "12" qw
xx yy zz "23" we
bb qw we "123249" jh
here 12,23,123249. is the line number
now according to this line numbers we have to print lines from other file named... (11 Replies)
Discussion started by: kumar_amit
11 Replies
8. Shell Programming and Scripting
I am trying to copy a folder which contains a list of C executables.
It takes 2 mins for completion,where as the entire script takes only 3 more minutes for other process.
Is there a way to copy the folder faster so that the performance of the script will improve? (2 Replies)
Discussion started by: prasperl
2 Replies
9. UNIX for Dummies Questions & Answers
I logged in as root and visudo'd /etc/sudoers.
I found several users with the username ALL=(ALL) ALL entries and added an account after the last one.
Saved the file.
When the user logs in and does "sudo su -" they are prompted for their password and then told they are not in the sudoers file.... (8 Replies)
Discussion started by: rpm_on_lnx
8 Replies
10. Shell Programming and Scripting
Can someone please help me with this I can't make it work?
find /test -type f \( ! -perm -u+w -o -perm -g+w \) | egrep -v "/test/A|/test/B"|xargs chmod u+rw,g+r-w,o=
I am getting error "Operation not permitted."
I want to find files, exclude directory A & B and change permission on the... (2 Replies)
Discussion started by: Jang
2 Replies
LEARN ABOUT CENTOS
log::message::simple
Log::Message::Simple(3) User Contributed Perl Documentation Log::Message::Simple(3)
NAME
Log::Message::Simple - Simplified interface to Log::Message
SYNOPSIS
use Log::Message::Simple qw[msg error debug
carp croak cluck confess];
use Log::Message::Simple qw[:STD :CARP];
### standard reporting functionality
msg( "Connecting to database", $verbose );
error( "Database connection failed: $@", $verbose );
debug( "Connection arguments were: $args", $debug );
### standard carp functionality
carp( "Wrong arguments passed: @_" );
croak( "Fatal: wrong arguments passed: @_" );
cluck( "Wrong arguments passed -- including stacktrace: @_" );
confess("Fatal: wrong arguments passed -- including stacktrace: @_" );
### retrieve individual message
my @stack = Log::Message::Simple->stack;
my @stack = Log::Message::Simple->flush;
### retrieve the entire stack in printable form
my $msgs = Log::Message::Simple->stack_as_string;
my $trace = Log::Message::Simple->stack_as_string(1);
### redirect output
local $Log::Message::Simple::MSG_FH = *STDERR;
local $Log::Message::Simple::ERROR_FH = *STDERR;
local $Log::Message::Simple::DEBUG_FH = *STDERR;
### force a stacktrace on error
local $Log::Message::Simple::STACKTRACE_ON_ERROR = 1
DESCRIPTION
This module provides standardized logging facilities using the "Log::Message" module.
FUNCTIONS
msg("message string" [,VERBOSE])
Records a message on the stack, and prints it to "STDOUT" (or actually $MSG_FH, see the "GLOBAL VARIABLES" section below), if the "VERBOSE"
option is true. The "VERBOSE" option defaults to false.
Exported by default, or using the ":STD" tag.
debug("message string" [,VERBOSE])
Records a debug message on the stack, and prints it to "STDOUT" (or actually $DEBUG_FH, see the "GLOBAL VARIABLES" section below), if the
"VERBOSE" option is true. The "VERBOSE" option defaults to false.
Exported by default, or using the ":STD" tag.
error("error string" [,VERBOSE])
Records an error on the stack, and prints it to "STDERR" (or actually $ERROR_FH, see the "GLOBAL VARIABLES" sections below), if the
"VERBOSE" option is true. The "VERBOSE" options defaults to true.
Exported by default, or using the ":STD" tag.
carp();
Provides functionality equal to "Carp::carp()" while still logging to the stack.
Exported by using the ":CARP" tag.
croak();
Provides functionality equal to "Carp::croak()" while still logging to the stack.
Exported by using the ":CARP" tag.
confess();
Provides functionality equal to "Carp::confess()" while still logging to the stack.
Exported by using the ":CARP" tag.
cluck();
Provides functionality equal to "Carp::cluck()" while still logging to the stack.
Exported by using the ":CARP" tag.
CLASS METHODS
Log::Message::Simple->stack()
Retrieves all the items on the stack. Since "Log::Message::Simple" is implemented using "Log::Message", consult its manpage for the
function "retrieve" to see what is returned and how to use the items.
Log::Message::Simple->stack_as_string([TRACE])
Returns the whole stack as a printable string. If the "TRACE" option is true all items are returned with "Carp::longmess" output, rather
than just the message. "TRACE" defaults to false.
Log::Message::Simple->flush()
Removes all the items from the stack and returns them. Since "Log::Message::Simple" is implemented using "Log::Message", consult its
manpage for the function "retrieve" to see what is returned and how to use the items.
GLOBAL VARIABLES
$ERROR_FH
This is the filehandle all the messages sent to "error()" are being printed. This defaults to *STDERR.
$MSG_FH
This is the filehandle all the messages sent to "msg()" are being printed. This default to *STDOUT.
$DEBUG_FH
This is the filehandle all the messages sent to "debug()" are being printed. This default to *STDOUT.
$STACKTRACE_ON_ERROR
If this option is set to "true", every call to "error()" will generate a stacktrace using "Carp::shortmess()". Defaults to "false"
perl v5.16.3 2013-01-23 Log::Message::Simple(3)