02-29-2012
Unix scripting
i need help with this problem this is the problem: Write a script that logs how many users login on/off the system over a 5 minute period. It can run in the foreground, and run 4 times a minute. Set a trap that will not allow a CNTRL-C command, and if a CNTRL-C is excuted store the time and date that the CNTRL-C was executed in a file. Make sure the file included each instance a CNTRL-C was executed.
so i am just confused on how to write this in vi, if anyone could help me out that would be great thanks!
Last edited by Scott; 02-29-2012 at 11:24 PM..
Reason: Hmmm
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
:confused: I need to find a place or places on the Internet where I can find UNIX scripts to view and to modify to make life easy on the UNIX environment. Can someone help me on this. Thanks (7 Replies)
Discussion started by: wolf
7 Replies
2. UNIX for Dummies Questions & Answers
Can anybody tell me the best way to learn unix scripting.can you recommend a good book.Please help! (1 Reply)
Discussion started by: hella
1 Replies
3. Shell Programming and Scripting
please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
I am new to Unix Scripting. I have below scenario. I need to write a Unix function with the following.
1. I have table. From this table I need to write a query.
SELECT Col1(File_nm),Col2(From_Loc),Col3(To_Loc)
FROM A
WHERE CONDITION
For... (1 Reply)
Discussion started by: sree11
1 Replies
5. UNIX for Dummies Questions & Answers
Hello every one, plz help me out. I m using 4 files in unix, like file1, file2, file3,file4 in which primary key is ID in column(field) of 4 files.
On the bases of ID, i want the corresponding field of 4 files in final file let say collected file. In collected file, ID column should occur only one... (16 Replies)
Discussion started by: kaprus
16 Replies
6. UNIX for Dummies Questions & Answers
Hi Gurus,
I am a system admin in solaris field and ive planned to study unix scripting.ive planned to start reading Mastering Unix scripting by randal.Scripts in that are based on Korn shell(ksh).my question is whether the same scripts can be applied to other shells like bash etc..And... (1 Reply)
Discussion started by: madanmeer
1 Replies
7. Shell Programming and Scripting
Hi Gurus,
I am a system admin in solaris field and ive planned to study unix scripting.ive planned to start reading Mastering Unix scripting by randal.Scripts in that are based on Korn shell(ksh).my question is whether the same scripts can be applied to other shells like bash etc..And... (4 Replies)
Discussion started by: madanmeer
4 Replies
8. Shell Programming and Scripting
how to check if a unix script gets executed without errors across all unix platforms.
incase if a script gets executed without errors only one platform say AIX, what needs to be done to that script such that it will run all unix platforms like linux, hp, sun etc (2 Replies)
Discussion started by: rmann
2 Replies
9. UNIX for Dummies Questions & Answers
Hello Experts,
I have the following questions to be discussed here at this esteemed discussion forum.
I have two Excel sheets which contain Unix Commands llike creating directory the structure/ftp/Copy/Zip etc to basically create an environment. I need help in understanding some of... (1 Reply)
Discussion started by: faizsaadq
1 Replies
10. Shell Programming and Scripting
LIST=/home/xxxxxxx/ABC/xeeno_scrpts/temp/tempfile
ERRORDIR=/home/xxxxxxx/ABC/error_directory
EMAILFILE=/home/xxxxxxx/ABC/xeeno_scrpts/temp/emailfile
echo "There were errors in the following report file for Xeenos:" > $EMAILFILE
echo >> $EMAILFILE
echo "This files have been moved to... (9 Replies)
Discussion started by: bcarosi
9 Replies
LEARN ABOUT DEBIAN
rancid-run
rancid-run(1) General Commands Manual rancid-run(1)
NAME
rancid-run - run rancid for each of the groups
SYNOPSIS
rancid-run [-V] [-f rancid.conf] [-f rancid.conf] [-m mail_rcpt] [-r device_name] [group [group ...]]
DESCRIPTION
rancid-run is a sh(1) script to run rancid(1) for a set of rancid group(s).
rancid-run reads rancid.conf(5) to configure itself, then uses control_rancid(1) to run rancid(1) for each rancid group. The set of rancid
groups can either be provided as command-line arguments or via the LIST_OF_GROUPS variable in rancid.conf(5), if the group argument is
omitted.
A lock file is maintained per-group to prevent simultaneous runs for a given group by rancid-run(1). The lock file will be named
.<group>.run.lock and will be located in /var/lib/rancid.
A log file is produced under $LOGDIR/logs for each rancid group processed. The file name will be <group>.YYYYMMDD.HHMMSS (year month day .
hour minute second).
rancid-run is normally used to run rancid from cron(8). For example:
0 * * * * /usr/local/rancid/bin/rancid-run
The command-line options are as follows:
-V Prints package name and version strings.
-f rancid.conf
Specify an alternate configuration file.
-m mail_rcpt
Specify the recipient of diff mail, which is normally rancid-<group>. The argument may be a single address, multiple comma
separated addresses, or -m may be specified multiple times.
-r device_name
Run rancid for a single device, device_name. device_name should be name, as it appears in a group's router.db. The device must be
marked "up". If a group is not specified on the command-line, rancid will be run against any group in which the device_name
appears.
The -r option alters the subject line of the diff mail. It will begin with <group name>/<device name> rather than just the group
name alone.
ENVIRONMENT
rancid-run utilizes the following environment variables from rancid.conf(5).
BASEDIR
Location of group directories, etc. This is set to the "localstatedir" by the configure script at installation time.
LIST_OF_GROUPS
List of rancid groups to collect.
PATH Search path for utilities.
TMPDIR Directory to hold temporary files.
ERRORS
If rancid fails to run or collect a device's configuration, the particular group's log file (mentioned above) should be consulted. Any
errors produced by the revision control system (CVS or Subversion) or any of the rancid scripts should be included there, whether they be a
botched cvs tree, login authentication failure, rancid configuration error, etc. If the log file produces no clues, the next debugging
step should be run the commands manually. For example, can the user who runs rancid login to the device with 'clogin hostname', and so on.
FILES
$BASEDIR/etc/rancid.conf
rancid-run configuration file.
SEE ALSO
control_rancid(1), rancid.conf(5), router.db(5)
5 October 2006 rancid-run(1)