ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I am new to shell scripts. I have a script to create some files on remote server. The file will be created in say 2 minutes. I want to exit after this part and loop to the next day. How can I do that. The part of the script is posted below and where I need to exit is also mentioned. Please help me in this.
Thanks in advance.
------------------------------------------
-------------------------------------------
while ( $difdt > 0) {
@date = ($year, $month, $day);
my $date = sprintf("%d-%02d-%02d", $year, $month, $day);
-------------------------------------------------------
----------------------------------------------------------
----------------------------------------------------------------
target => "data_flex3d_075_${date}.grib",
);
I WANT TO EXIT FROM HERE AFTER 1 MIN AND GO TO THE NEXT DAY
# move to next day
($year, $month, $day) = Add_Delta_Days($year, $month, $day, 1);
$difdt = Delta_Days(@date, @enddate);
print "Date=",$date, "\n";
}
Hello,
I am new to shell scripts. I have a script to create some files on remote server. The file will be created in say 2 minutes. I want to exit after this part and loop to the next day. How can I do that. The part of the script is posted below and where I need to exit is also mentioned. Please help me in this.
Hi,
1) Is this code snippet Perl, I am guessing?
2) What do you mean by "loop to the next day"? Do you mean that you literally want the script not to function until some future time is met, or do you mean that you want to advance the time string you are using to create files?
3) Can you show more of the code that will help us to better understand exactly what it is you are trying to do (or explain it better)?
hi,
Yes it is perl script. what I use the script for is to fetch some data from some server. In that script it creates the data and prepare it as a file say out.grb. Then it downloads the file to mu local machine. I want to escape from the section of downloading. Instead I want to create files for everyday. Then I know the file locations for these files and download using some download manager. What I manually do is, change the date manually, execute the script, when the file is created I press control+C and edit the file for next date. So I want to parse the contro+C to this script after waiting for 2 minutes (thinking it will create the files in two minutes) then move to next date, create file, after 2 minutes exit and so forth.
Is it sufficient?
Thank you very much
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.