Piping the "script" command through the logger command.
I use the snippet below in /etc/profile on RHEL Linux to capture command line logging and it all works well and good.
Now I'd like to pipe the same output from script through the logger command so it all gets logged to syslog.
The only additional code I've added is in bold below (| bin/logger).
This works as expected sans one issue, albeit a major one. My terminal session is blank as if nothing is being typed, however if I type commands I can see them being logged and if I type exit my session closes. I tried a nohup and & to see if that would help but it does not. I'm wondering why I can no longer see anything on my tty.
This is what my putty session looks like. So I have a fully functional session but I can't see any output. [user@test1 ~]$ ssh cxxx
user@test1's password:
Last login: Thu Sep 12 09:56:01 2013 from 10.x.x.x
system() call imeplemented in solaris is such a way that:
Command not found - return code 1
Command executed successfully without Output - return code 1
how to distinguish between these two based on return code in a c - file?
Can you help on this ? (5 Replies)
Hello,
I am new to this forums and this is my first "asking help" message!
i have 2 problems:
1- for unknown reasons the "source" command is not avalable in my system (UBUNTU). i can't either see it in my bin directory!
2- again for unknown reasons the "login.cl" file in the home... (0 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this:
$ look "string" "/home/patrick/filename.txt"
However, this gives me the following message:
"look: /home/patrick/filename.txt: File too large"
So, I have two... (14 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
LEARN ABOUT SUNOS
logger
logger(1B) SunOS/BSD Compatibility Package Commands logger(1B)NAME
logger - add entries to the system log
SYNOPSIS
/usr/ucb/logger [-f filename] [-i] [-p priority] [-t tag] mm [message]...
DESCRIPTION
The logger utility provides a method for adding one-line entries to the system log file from the command line. One or more message argu-
ments can be given on the command line, in which case each is logged immediately. If message is unspecified, either the file indicated with
-f or the standard input is added to the log. Otherwise, a filename can be specified, in which case each line in the file is logged. If
neither is specified, logger reads and logs messages on a line-by-line basis from the standard input.
OPTIONS
The following options are supported:
-i Log the process ID of the logger process with each line.
-f filename Use the contents of filename as the message to log.
-p priority Enter the message with the specified priority. The message priority can be specified numerically, or as a facility.level
pair. For example, `-p local3.info' assigns the message priority to the info level in the local3 facility. The default pri-
ority is user.notice.
-t tag Mark each line added to the log with the specified tag.
EXAMPLES
Example 1: Logging a message
The command:
example% logger System rebooted
will log the message `System rebooted' to the facility at priority notice to be treated by syslogd as other messages to the facility notice
are.
Example 2: Logging messages from a file
The command:
example% logger -p local0.notice -t HOSTIDM -f /dev/idmc
will read from the file /dev/idmc and will log each line in that file as a message with the tag `HOSTIDM' at priority notice to be treated
by syslogd as other messages to the facility local0 are.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO syslogd(1M), syslog(3C), attributes(5)SunOS 5.10 14 Sep 1992 logger(1B)