i have a script which needs to be run every 10 minutes.This is achieved using crontab utility,
it is checking Number of calls on a service... if number of calls are not increasing then it will stop the service else do nothing.
Now in the script, i fetch the current value in variable myval and then compare it with variable COUNT_DEPOSIT
Here is the code:-
At the end, i reinitialize the variable COUNT_DEPOSIT with the new value so that next time COUNT_DEPOSIT variable has a new value..
But problem is that COUNT_DEPOSIT is everytime initialize to value 0
I want to initialize the this variable only once and pick the new value each time.
Write the variable (value) to a file, then read the file every time the script runs.
This has issues - at reboot of your app or the system, the file needs to be removed. Otherwise the code will "think" it has some previous value.
try that for a start
This User Gave Thanks to jim mcnamara For This Post:
Hello All,
What i am trying to do is read the input file delimited by pipe and do further logic like simulating the for loop but using awk not sure if this a right approach but as i was told doing "for i in `cat $file`" is an over kill so trying to replicate the same thing using awk script below.... (6 Replies)
Hi all
Just connected a SCSI tape drive to our ScoUnix server running Unixware 7.0.1. The ID assigned to it is 3.
When I open ArcServe it is saying that tape drive is not found and I cannot configure it.
How can I make the tape drive accessible to the system?
Thanks! (4 Replies)
Hi All,
Please can you advise on how can I initialize a variable with a line.
Suppose i want to initialize x with line redirects.www.virginatlantic.com.conf
Best Regards,
Shazin (1 Reply)
Hello Everyone,
Has anyboby ever come across the problem when fd refuses to get initialised. I try to use mediainit command, the fd is being accessed (the fd's LIT is green for some secs) but then I get the message - "Initialize media command failed - permission denied" I checked the diskette,... (1 Reply)
I use SCO UNIX from 2 years I need a command or procedure to make all log files empty and restart all counters like lp job number
:( :confused: :( (1 Reply)
Has anyone seen this message before?
I have a DNS problem. Recently DNS has been moved to two new servers, which I can ping. I changed the /etc/resolv.conf to point to these boxes but now I get the *** Can't initialize resolver message. Any ideas? (2 Replies)
Hi, i m trying to loop a variable value, Basically i m reading variable value from an input file and using in rest of the program. Bu my problem is when i first time read value and assign to variable it works fine, but in second read it concatinate second value to first value with a LF. I want to... (2 Replies)
I have a question about C program for Unix:
Do we have to intialize every variable before we use them in C?
I thought we have to untill I found some programs are not intialize the variable before they were used. (2 Replies)