[Solved] How do you get a "Ctrl-C trap" working w/ a piped "tail -f" ?
Hi All,
Although each line below seems to work by itself, I've been having trouble getting the Control-C trap working when I add the "|perl -pe..." to the end of the tail -f line, below.
(That |perl -pe statement basically just adds color to highlight the word "ERROR" while tailing a log file)
...Does anyone know how to make the 2 lines below co-exist together, so that the CTRL-C trap still works, below?
Thank you so much for the help,
CG
Last edited by chatguy; 04-15-2011 at 02:29 AM..
Reason: [Solved]
I wrote a ksh script for Helpdesk. I need to know how to disable ctrl-c,ctrl-z,ctrl-d..... so that helpdesk would not be able to get to system prompt :confused: (6 Replies)
how to trap the ctrl c in unix shell script
my script is running in while loop it should not be terminate with ctrl c.
if i press ctrl c while running script it shloud ignore the same.
please healp..........
thanks in advance (2 Replies)
Hello at my home when i try
tail +5 emp
it works but when i try in my college it doesn't work! what can be the problem any idea?
when i type
man tail
it gives me various options in which it's mentioned that tail +n can also work when you want to display from nth line. But... (3 Replies)
I've search the various posts in these forums, but have not come up with a solution to my problem.
I have a parent process that calls a child script, runs it in the background and the parent finishes - without waiting for the child process to complete. Inside the child, a trap is issued to trap... (6 Replies)
I am trying to trap CTRL-C, now the program I call has it's own exit message, I think this is the problem ..
This is what I have now :
function dothis
{
echo 'you hit control-c'
exit
}
function settrap
{
trap dothis SIGINT
}
settrap
until false; do
./ITGRecv.exe
doneDoing this I... (2 Replies)
Hello,
I have a script which copies via scp several large files to a remote server. What I want is that even if someone hits CTRL-C, the scp commands continues till the end.
Here is what I wrote
#! /bin/bash
function testFunction
{
echo "COPY START"
scp large.tar.gz... (11 Replies)
say i have a statement like this in a script
tail -f /opt/blah/blha/user.log > final.log
if ;then
cat final.log | grep -i "servicer_user" > service.log
cat final.log | grep -i "logic_user" > logic.log
fi
echo "script completed"
but when the script is running if i press ctrl + c the... (4 Replies)
Hi All,
I have ran one command tail -f <filename> to view newly appended text to that file. When i was done i pressed ctrl+c command to stop it but to my suprise it didn't work. I then tried top command and pressed ctrl+c and it worked fine and command aborted.
I then just checked the tail... (0 Replies)
Hi Folks -
For some reason, my trap command is not working. It's placed just prior to a normal exit:
#:: ------------------------------------------------------------------------
#::-- Script Name: LCM_Backup.sh
#::
#::-- Description: This script leverages Utility.sh to perform LCM... (16 Replies)
Hello:
Am trying to understand why the method #2 works but method #1 does not.
For both methods, sending CTRL+C should kill both the Parent script & all of the spanwd background procs.
Method #1:
==========================
#!/bin/sh
ctrl_c()
{
echo "** Trapped CTRL-C"
... (3 Replies)
Discussion started by: gilgamesh
3 Replies
LEARN ABOUT OPENSOLARIS
mdlogd
mdlogd(1M) System Administration Commands mdlogd(1M)NAME
mdlogd - Solaris Volume Manager daemon
SYNOPSIS
mdlogd
DESCRIPTION
mdlogd implements a simple daemon that watches the system console looking for messages written by the Solaris Volume Manger. When a Solaris
Volume Manager message is detected, mdlogd sends a generic SNMP trap.
To enable traps, you must configure mdlogd into the SNMP framework. See .
USAGE
mdlogd implements the following SNMP MIB:
SOLARIS-VOLUME-MGR-MIB DEFINITIONS ::= BEGIN
IMPORTS
enterprises FROM RFC1155-SMI
DisplayString FROM SNMPv2-TC;
-- Sun Private MIB for Solaris Volume Manager
sun OBJECT IDENTIFIER ::= { enterprises 42 }
sunSVM OBJECT IDENTIFIER ::= { sun 104 }
-- this is actually just the string from /dev/log that
-- matches the md: regular expressions.
-- This is an interim SNMP trap generator to provide
-- information until a more complete version is available.
-- this definition is a formalization of the old
-- Solaris DiskSuite mdlogd trap mib.
svmOldTrapString OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255))
ACCESS read-only
STATUS mandatory
DESCRIPTION
"This is the matched string that
was obtained from /dev/log."
::= { sunSVM 1 }
-- SVM Compatibility ( error trap )
svmNotice TrapTRAP-TYPE
ENTERPRISE sunSVM
VARIABLES { svmOldTrapString }
DESCRIPTION
"SVM error log trap for NOTICE.
This matches 'NOTICE: md:'"
::= 1
svmWarningTrap TRAP-TYPE
ENTERPRISE sunSVM
VARIABLES { svmOldTrapString }
DESCRIPTION
"SVM error log trap for WARNING..
This matches 'WARNING: md:'"
::= 2
svmPanicTrap TRAP-TYPE
ENTERPRISE sunSVM
VARIABLES { svmOldTrapString }
DESCRIPTION
"SVM error log traps for PANIC..
This matches 'PANIC: md:'"
::= 3
END
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWlvma, SUNWlvmr |
+-----------------------------+-----------------------------+
|Interface Stability |Obsolete |
+-----------------------------+-----------------------------+
SEE ALSO snmpdx(1M), attributes(5)SunOS 5.11 3 Jun 2004 mdlogd(1M)