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
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
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
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
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
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
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
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
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
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
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