How to set end limit while copying files of a range??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to set end limit while copying files of a range??
# 1  
Old 03-27-2014
Question How to set end limit while copying files of a range??

I have files being generated in format A20140326.00........ to A20140326.24.............

I need to copy these hourly basis from one location to another.
Eg. If i copy from 14 to 19 the hour, I use wildcard as A201403226.1[4-9]*.

Requirement is : I need to copy from 06 hour and wil run the script at 22:30 hour for instance. So Can anyone please help me in setting a wildcard which can do something like,
In the script i mention 6th hour and some wildcard whic increments to that hour,Instead of setting another hour.

I hope I am clear Smilie
# 2  
Old 03-27-2014
Ok, lemme see if I understand you correct.

Code:
from_date=$1
to_date=`date +%H`

for i in `seq -w ${from_date} $t` ;do
  echo $i;
  ## Put your copy logic here.
done

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Cannot subset ranges from another range set

Ca21chr2_C_albicans_SC5314 2159343 2228327 Ca21chr2_C_albicans_SC5314 636587 638608 Ca21chr2_C_albicans_SC5314 5286 50509 Ca21chr2_C_albicans_SC5314 634021 636276 Ca21chr2_C_albicans_SC5314 1886545 1900975 Ca21chr2_C_albicans_SC5314 610758 613544... (9 Replies)
Discussion started by: cryptodice
9 Replies

2. UNIX for Beginners Questions & Answers

Set hard block limit for user using quota

hi all, i have installed quota on my centos 7 machine and its what im after (setting size limit on users, so they cant fill the hard drive) i want to now make this part of my create user script for my sftp server so i want to do a echo and a read command so i capture the limit they enter... (0 Replies)
Discussion started by: robertkwild
0 Replies

3. Shell Programming and Scripting

Help with sum range of data set together

Input File: 2000 3 1998 2 1997 2 1994 1 1991 1 1989 1 1987 2 1986 2 1985 1 1984 1 . . 10 277256 9 278274 8 282507 7 284837 6 287066 5 292967 (4 Replies)
Discussion started by: perl_beginner
4 Replies

4. Shell Programming and Scripting

Rsync copying within recent date range?

As many will point out, one of the benefits of using rsync (without --delete) is that it will sync files between source and destination, but not delete files in the destination which HAVE been deleted in the source. Well, I have kind of the opposite problem and I'm wondering if there are date... (2 Replies)
Discussion started by: WIOP33
2 Replies

5. Shell Programming and Scripting

How to set character limit on READ?

Hello, I created the following (snippet from larger code): echo -n "A1: " read A1 VERIFY=$(echo -n $A1|wc -c) if ; then echo -e "TOO MANY CHARACTERS" fi echo -n "A2: " read A2 echo -n "A3: " read A3 echo -e "Concat: $B1/$B2/$B3" Basically what it does is it... (4 Replies)
Discussion started by: jl487
4 Replies

6. Shell Programming and Scripting

How to add a line to the end of a set of files without using sed command?

I understand that the SED command reads all the lines in the file before adding a required line to the end of the file. Is there another command that adds a line to the end of files without reading the entire file.... SED is increasing the processing time as the number of lines in each of the... (1 Reply)
Discussion started by: Kanch
1 Replies

7. Shell Programming and Scripting

copying to the end of the line

Hi, I have a file as such 1 <text1><text2></ 2 <text3><text4></ 3 <text5><text6></ 4 <text7><text8></ I need is so the first bit of text in the line is at the end as its xml so 1 <text1><text2></text1> 2 <text3><text4></text3> 3 <text5><text6></text5> 4 ... (12 Replies)
Discussion started by: legolad
12 Replies

8. Shell Programming and Scripting

csh shell script 'set' argument limit?

Hi , I have a script that is causing a problem that led me to think if there is a limit to the number of arguments for 'set' command in csh shell script. Here is my script: #!/bin/csh -f set top = design_top #1 set v_mbist = ( sim_mbist/*.v ) #2 set v_simlist = ( -v... (2 Replies)
Discussion started by: return_user
2 Replies

9. Shell Programming and Scripting

I need to set a time limit for a script

Hello Folks, I have been asked to write a test script which can be run by students. the script should have a time limit. I have almost completed it except the bit of timing! I've seen something like this: on_timeout() { echo "$USER $score " >> theresult.txt echo "Time out!... (2 Replies)
Discussion started by: SultanKSA
2 Replies

10. Solaris

How to set Root password age limit in Solaris 9/10

Hi Friends, Can anyone tell me how can I set the password age limit for root user to 14 days....??? Also would like to add following for root password; min-alpha --- 4 min-other --- 1 min-length -- 6 min-diff ----- 3 How can I do these on command line....??? Regards, jumadhiya (7 Replies)
Discussion started by: jumadhiya
7 Replies
Login or Register to Ask a Question