10-02-2012
Notification of the modification of a specific entry in a file
I need to get notification via email when the line containing a pattern is changed in a file. Not during the time any changes to file occurs. Ie if we reset a user password say example, demouser the hash in the line containing the word demouser in the file /etc/group changes. So when this change occurs to the line containing demouser, a notification mail should be send, along with the details of the process that made this change. Is it possible?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi Friends,
iam trying to write a script which will grep the particular entry in crontab of root and enable/disable it .iam a novice in scripting. your suggestions are most welcome..please help
Cheers!! (4 Replies)
Discussion started by: munishdh
4 Replies
2. UNIX for Dummies Questions & Answers
Hi
I am accessing a file on nfs mounted device, after completing using of the file, i am tring to restore the access time and modification times of the file.
So i got the previous modified time of the file using stat() function and trying to set the date and time for the file, To set these... (6 Replies)
Discussion started by: deepthi.s
6 Replies
3. Shell Programming and Scripting
How can I get and display the last modification time of a file? in scripting or specifically using Batch file
I want this info for me to determine whether an image has been edited or not by using the last modification time and compare it to our stored date of modification.
can somebody help... (5 Replies)
Discussion started by: jaque18
5 Replies
4. Shell Programming and Scripting
Hi !
I am a newbie and never officially wrote a shell script before.
The requirement for this script is :
1) Read a file called 'bpm.log' and identify if it has a specific text such as 'this is the text'. Its a static value and that is the only text we need to read.
2) If that... (2 Replies)
Discussion started by: atechcorp
2 Replies
5. Shell Programming and Scripting
Hello All,
can someone please suggest me a one line command to change a specific value that is associated to an entry in the file.
for example
#more schedulefile
quartz.job.manual.bonus.schedule=0 0 9 ? * *
#
it should be changed to
#more schedulefile... (5 Replies)
Discussion started by: bobby320
5 Replies
6. Shell Programming and Scripting
Hi guys, I'm new to bash programming, so please pardon me.
I'm trying to replace an entry's text in Books.txt
This code works perfectly:
sed -i "s/$BookTitle/$NewBookTitle/g" Books.txt
But problem is, if there are double entries, it will also replace that entry. For example:
... (12 Replies)
Discussion started by: todaealas
12 Replies
7. UNIX for Dummies Questions & Answers
Hey Guys and Gals,
I am having trouble with what I thought shouldn't be hard..
In a script I am working on there is a need to enter a MAC address.
MAC addresses are formatted ;
XX:XX:XX:XX:XX:XX
where X can be 0-9, a-f or A-F
So in the sample script the query is something... (4 Replies)
Discussion started by: TAPE
4 Replies
8. Shell Programming and Scripting
Hi
This is my first post and I'm just a beginner. So please be nice to me.
I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file?
I have tried sed -n 241,241p... (13 Replies)
Discussion started by: dejavo
13 Replies
9. Programming
file1
cat
dog
fish
file2
This is a bunch of lines
<!-- INSERT ANIMALS HERE -->
horse
cheetah
post results
file2
This is a bunch of lines
<!-- INSERT ANIMALS HERE -->
cat
dog
fish
horse (1 Reply)
Discussion started by: TY718
1 Replies
10. How to Post in the The UNIX and Linux Forums
Hi All,
Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries.
example:
Parent is :
----------
dn: email=yogesh.kumar@wipro.com, o=wipro, o=in
child is:
----------
dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
Discussion started by: Chand
1 Replies
LEARN ABOUT OPENSOLARIS
scsi_reset_notify
scsi_reset_notify(9F) Kernel Functions for Drivers scsi_reset_notify(9F)
NAME
scsi_reset_notify - notify target driver of bus resets
SYNOPSIS
#include <sys/scsi/scsi.h>
void scsi_reset_notify(struct scsi_address *ap, int flag,
void (*callback)(caddr_t), caddr_t arg);
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI).
PARAMETERS
ap Pointer to the scsi_address structure.
flag A flag indicating registration or cancellation of the notification request.
callback A pointer to the target driver's reset notification function.
arg The callback function argument.
DESCRIPTION
The scsi_reset_notify() function is used by a target driver when it needs to be notified of a bus reset. The bus reset could be issued by
the transport layer (e.g. the host bus adapter (HBA) driver or controller) or by another initiator.
The argument flag is used to register or cancel the notification. The supported values for flag are as follows:
SCSI_RESET_NOTIFY Register callback as the reset notification function for the target driver.
SCSI_RESET_CANCEL Cancel the reset notification request.
Target drivers can find out whether the HBA driver and controller support reset notification by checking the reset-notification capability
using the scsi_ifgetcap(9F) function.
RETURN VALUES
If flag is SCSI_RESET_NOTIFY, scsi_reset_notify() returns:
DDI_SUCCESS The notification request has been accepted.
DDI_FAILURE The transport layer does not support reset notification or could not accept this request.
If flag is SCSI_RESET_CANCEL, scsi_reset_notify() returns:
DDI_SUCCESS The notification request has been canceled.
DDI_FAILURE No notification request was registered.
CONTEXT
The scsi_reset_notify() function can be called from user, interrupt, or kernel context.
SEE ALSO
scsi_address(9S), scsi_ifgetcap(9F)
Writing Device Drivers
SunOS 5.11 16 Jan 2006 scsi_reset_notify(9F)