Sponsored Content
Top Forums Shell Programming and Scripting Sign on/Sign off logging script Post 302096735 by Glider on Friday 17th of November 2006 02:42:38 PM
Old 11-17-2006
Sign on/Sign off logging script

I'd like to make a script that I can execute every time I sign on to my linux box that keeps track of the time and allows to me to add a remark to a file. So basically once I log in, I run the script, and it outputs the date and time to a text file (log.txt). But that isn't my problem.

I need to know how to make it so once i've executed the script in a session, it won't allow me to execute it twice until i've run a sign out script. I'd like it to say something along the lines of "Sorry, you are already signed in!" if i've already run the sign in script.

Then, I need to know what to add to the sign OUT script in order to make it go back to normal the normal signed out state.

I don't know if this makes any sense, but any input would be appreciated! I'll be checking the thread to answer any questions as often as possible. Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Meaning of % sign

Does % sign have any impact, special meaning in unix shell scripts ??? (2 Replies)
Discussion started by: sokash
2 Replies

2. UNIX for Dummies Questions & Answers

(+ sign) Unexpected arithmetic expr script interpretation

I have created the following script to add 2 numbers together : lazyadd2 script : #!/bin/bash #I have added the she-bang script above as I felt that this would be a good idea. #The script takes in 2 arguments that are added together num3=`expr $num1 + $num2` echo $num3 I make the... (9 Replies)
Discussion started by: Birdi6022
9 Replies

3. UNIX for Dummies Questions & Answers

minus sign

why a minus sign is put for options in unix commands suggestions plz (2 Replies)
Discussion started by: trichyselva
2 Replies

4. UNIX for Dummies Questions & Answers

@ sign in permissions?

I am using Mac OS X version 10.5.7, and had a problem accessing a folder on our shared area network. I logged in via terminal (bash shell), and did a ls -l on the main directory, and the directory that isn't showing up has an @ sign at the end: rwxr-xr-x@ 19 admin staff 2048 Jun 1 07:53... (1 Reply)
Discussion started by: aaronstella
1 Replies

5. Shell Programming and Scripting

Count value between | sign

Hi I have a file inw which values are seperated by "|" I want to count number of values present in each line of the file Input file AS|23 34|BD|A2|890 AK|23 44|D|A2|89076|89 AF|23 34|BD|A2|8 Result 5 6 5 there are 5 values inside | sign hence o/p will be 5 similarly in... (2 Replies)
Discussion started by: aaysa123
2 Replies

6. Shell Programming and Scripting

Using grep $ sign help?

hi so I was debugging some scripts and I ran into a problem that did not come up before grep -n "$variable"$ ./file.txt I figured the second $ is meant to reference the end of the line but this gave me trouble in my c shell. anyone know whats wrong here or how to rewrite this??? Thank... (2 Replies)
Discussion started by: vas28r13
2 Replies

7. Shell Programming and Scripting

SSH Script is sticking, & sign not doing what I would expect

I am having an issue where I am do an SSH to about 30 servers one at a time however my script is getting hung up sometimes on the SSH. I thought the & at the end as seen below would fire it and move on but that does not seem to be working. #!/bin/s for remsys in trumpetsnail angel delphin... (3 Replies)
Discussion started by: LRoberts
3 Replies

8. Shell Programming and Scripting

Script to replace last instance of . between two consecutive = sign by ,

Suppose you have a line like this: cn=user.blr.ou=blr.india.o=company The line should be converted like this: cn=user.blr,ou=blr.india,o=comapny Was wondering how to do that using shell script. Please use tags where appropriate, thank you (4 Replies)
Discussion started by: saurabhkoar
4 Replies

9. Forum Support Area for Unregistered Users & Account Problems

Unable to sign in

I am unable to sign in to the UNIX forum. I tried my username "timotei2" and the password - but access was denied. My email address - <removed> - was not recognised, either. This is strange as I registered some years back. Should I re-register, or can nyou re-set my log in credentials? (1 Reply)
Discussion started by: Unregistered
1 Replies

10. Forum Support Area for Unregistered Users & Account Problems

Sign in issues

I tried logging in under my username (Michael Mullig) but as it's been a while I've forgotten my password. None of my email addresses are recognized either. Thinking that my username my have been purged due to lack of activity (understandable) I tried to re-register, only to find the name is still... (2 Replies)
Discussion started by: Mike Mullig
2 Replies
rc3(8)							      System Manager's Manual							    rc3(8)

NAME
rc3 - Run command script executed when entering a multiuser run level SYNOPSIS
rc3 DESCRIPTION
The rc3 script contains run commands that enable initialization of the system to a multiuser state; run level 3. In addition to commands listed within the script itself, rc3 contains instructions to run certain commands found in the /sbin/rc3.d directory. The script defines the conditions under which the commands execute; some commands run if the system is booting, other commands execute if the system is chang- ing run levels. By convention, files in the rc3.d directory begin with either the letter "S" or the letter "K" and are followed by a two-digit number and a filename; for example: S00inet S55inetd S70mount S65lpd In general, the system starts commands that begin with the letter "S" and stops commands that begin with the letter "K." Commands that begin with the letter "K" run only when the system is changing run levels from a higher to a lower level. Commands that begin with the letter "S" run in all cases. The numbering of commands in the /sbin/rc3.d directory is important since the numbers are sorted and the com- mands are run in ascending order. Files in the /sbin/rc3.d directory are normally links to files in the /etc/init.d directory. An entry in the inittab file causes the system to execute the rc3 run commands, for example: s3:3:wait:/sbin/rc3 < /dev/console > /dev/con- sole 2>&1 The following operations are typical of those that result from executing the rc3 script and the commands located in the /sbin/rc3.d direc- tory. The operation depends on which state the system is entering or exiting. Setting the time zone Checking the current run level Start- ing network services and daemons Starting (or stopping) system services and daemons Mounting file systems Setting the TIMEZONE variable is one of the first operations completed by the rc3 script. This action provides the default time zone for subsequent commands. FILES
Specifies the command path Specifies the directory of commands that correspond to the run level RELATED INFORMATION
Commands: init(8), rc0(8), rc2(8) delim off rc3(8)
All times are GMT -4. The time now is 05:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy