checking for a flag in a subscript?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting checking for a flag in a subscript?
# 1  
Old 02-16-2009
Java checking for a flag in a subscript?

I want to incorportae a subscript in a job script which is used for loading purposes.
What i require is that before a job runs it should check for a flag ,if flag is not present then create it and the loading should start.
Once loading finishes it should delete the flag.
So if any other load comes while loading is happening it should wait until that flag is deleted by the previous load?
# 2  
Old 02-16-2009
Quote:
Originally Posted by bathla
I want to incorportae a subscript in a job script which is used for loading purposes.

What do you mean by a "subscript"?

You can use a function or another script; either can be called just as any other command.
Quote:
What i require is that before a job runs it should check for a flag

What's a "flag"? Do you mean a file? If so, what is it called?
Quote:
,if flag is not present then create it and the loading should start.
Once loading finishes it should delete the flag.

You can check for the presence of a file with "test -f FILENAME".
Quote:
So if any other load comes while loading is happening it should wait until that flag is deleted by the previous load?
# 3  
Old 02-18-2009
thank you..

subscript basically means a function only...
by flag i mean a file ..that is like "load_running"....
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Calling subscript with sh vs. ksh

I ran into an issue today that I was able to resolve, but I don't quite understand why the resolution worked. I'm wondering if anyone can help me make sense of it. I have a "kicker" script that calls 4 subscripts on a RHEL 6.9 server. It calls the scripts in sequence checking for a 0 exit code... (5 Replies)
Discussion started by: derndingle
5 Replies

2. Shell Programming and Scripting

Checking plsql flag status in UNIX

Hi,I have a stored procedure to verify no of months since current fiscal.I want a shell script to exit with returtn code when the verification fails,I have shell script below but this doesnt work sqlplus / << EOF WHENEVER SQLERROR exit 1 WHENEVER OSERROR exit 2 DECLARE v_time_period... (2 Replies)
Discussion started by: haadiya
2 Replies

3. UNIX for Dummies Questions & Answers

Name of subscript

I have a script that executes another, so script1 executes script2. Using the $0 variable inside script2 returns the name of script1. How can I get the name of script2? Thanks (2 Replies)
Discussion started by: charding1
2 Replies

4. Shell Programming and Scripting

How to use a subscript and a super script while printing a character

I want to print a output after executing a awk command How to represent a subscript or a superscript while using print command eg : Ts. where character 's' is subscript of T T2 where '2' is the superscript of T thank you. Shashi: (3 Replies)
Discussion started by: shashi792
3 Replies

5. Shell Programming and Scripting

How to solve Subscript out of range?

Hi everyone I want to compare numbers line by line Example array = 12 15 15 19 14 I have code: #!bin/csh set a = 1 set b = 2 while($a<6) if($array == $array)then echo "EQUAL" else if($array < $array)then echo "SMALLER" else echo "BIGGER" endif @ a = $a + 1 @ b = $b + 1 (2 Replies)
Discussion started by: vincyoxy
2 Replies

6. UNIX for Dummies Questions & Answers

creating a subscript which checks for a flag?

I want to incorportae a subscript in a job script which is used for loading purposes. What i require is that before a job runs it should check for a flag ,if flag is not present then create it and the loading should start. Once loading finishes it should delete the flag. So if any other load... (3 Replies)
Discussion started by: bathla
3 Replies

7. AIX

Checking for flag in a subscript?

I want to incorportae a subscript in a job script which is used for loading purposes. What i require is that before a job runs it should check for a flag ,if flag is not present then create it and the loading should start. Once loading finishes it should delete the flag. So if any other load... (1 Reply)
Discussion started by: bathla
1 Replies

8. Shell Programming and Scripting

Perl hashes "Can't use subscript on private hash"

This is driving me mad, where am I going wrong? The relevant segment of code: sub getndsybcons { my @servers=@{$_}; my @sybservers=@{$_}; my %results; foreach my $server(@servers) { my $biggestsyb; my $biggestsybval=0; ... (9 Replies)
Discussion started by: Smiling Dragon
9 Replies

9. Shell Programming and Scripting

Shell to run one after another checking any flag or file

a.ksh & b.ksh run at the same time and takes huge resource and time.I want to put a technique so that one wil run after another. eg put a flag so that each script will check if it running , then sleep and wait it to finish. Can some one advise (3 Replies)
Discussion started by: konark
3 Replies

10. Shell Programming and Scripting

Calling subscript but sleep halts the main script

Ok, I have written a main script which checks a directory contents every 30 secs then sleeps. The subscript does a usermod, if the user is logged on, it sleeps for 30 secs and then trys again over and over again. Here's the problem. when the subscript is called ./subscript.sh or exec... (1 Reply)
Discussion started by: doublejz
1 Replies
Login or Register to Ask a Question