Sponsored Content
Top Forums Shell Programming and Scripting Sign on/Sign off logging script Post 302096951 by Andrek on Monday 20th of November 2006 08:41:47 PM
Old 11-20-2006
I guess the easiset way is to create a "lock file"

ie
The first thing you do is check to see if a "lockfile" exist, if not, then it must be the first time and you touch a filesomewhere.....ie create the lockfile

continue process the rest of the script

The last thing the script does before it ends is remove the lock file.

That way if it starts up again....it won't do any thing...because the previous execution created a lock file and is still open at that time....

does that make sense?
 

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
SCRIPT(1)						    BSD General Commands Manual 						 SCRIPT(1)

NAME
script -- make typescript of terminal session SYNOPSIS
script [-a] [-k] [-q] [-t time] [file [command ...]] DESCRIPTION
The script utility makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1). If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript. If the argument command ... is given, script will run the specified command with an optional argument vector instead of an interactive shell. Options: -a Append the output to file or typescript, retaining the prior contents. -k Log keys sent to program as well as output. -q Run in quiet mode, omit the start and stop status messages. -t time Specify time interval between flushing script output file. A value of 0 causes script to flush for every character I/O event. The default interval is 30 seconds. The script ends when the forked shell (or command) exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not set) for the C-shell, csh(1)). Certain interactive commands, such as vi(1), create garbage in the typescript file. The script utility works best with commands that do not manipulate the screen. The results are meant to emulate a hardcopy terminal, not an addressable one. ENVIRONMENT
The following environment variable is utilized by script: SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most shells set this variable automatically). SEE ALSO
csh(1) (for the history mechanism). HISTORY
The script command appeared in 3.0BSD. BUGS
The script utility places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects. It is not possible to specify a command without also naming the script file because of argument parsing compatibility issues. When running in -k mode, echo cancelling is far from ideal. The slave terminal mode is checked for ECHO mode to check when to avoid manual echo logging. This does not work when in a raw mode where the program being run is doing manual echo. BSD
June 6, 1993 BSD
All times are GMT -4. The time now is 10:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy