Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

gmtmath_times.sh 1.2 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  1. #!/usr/bin/env bash
  2. # Test that the -T option for gmt math works with appended time units
  3. # Testing year interval
  4. gmt math -o0 -T1980-01-01T/1988-12-31T/4y+t T = out
  5. echo "1980-01-01T00:00:00" > in
  6. echo "1984-01-01T00:00:00" >> in
  7. echo "1988-01-01T00:00:00" >> in
  8. # Testing month interval
  9. gmt math -o0 -T1980-01-01T/1980-12-31T/4o T = >> out
  10. echo "1980-01-01T00:00:00" >> in
  11. echo "1980-05-01T00:00:00" >> in
  12. echo "1980-09-01T00:00:00" >> in
  13. # Testing day interval
  14. gmt math -o0 -T1980-01-01T/1980-01-12T/4d T = >> out
  15. echo "1980-01-01T00:00:00" >> in
  16. echo "1980-01-05T00:00:00" >> in
  17. echo "1980-01-09T00:00:00" >> in
  18. # Testing hour interval
  19. gmt math -o0 -T1980-01-01T00:00:00/1980-01-01T04:00:00/2h T = >> out
  20. echo "1980-01-01T00:00:00" >> in
  21. echo "1980-01-01T02:00:00" >> in
  22. echo "1980-01-01T04:00:00" >> in
  23. # Testing minute interval
  24. gmt math -o0 -T1980-01-01T00:09:00/1980-01-01T00:11:00/1m T = >> out
  25. echo "1980-01-01T00:09:00" >> in
  26. echo "1980-01-01T00:10:00" >> in
  27. echo "1980-01-01T00:11:00" >> in
  28. # Testing second interval
  29. gmt math -o0 -T1980-01-01T00:00:10/1980-01-01T00:00:30/10s T = >> out
  30. echo "1980-01-01T00:00:10" >> in
  31. echo "1980-01-01T00:00:20" >> in
  32. echo "1980-01-01T00:00:30" >> in
  33. diff out in --strip-trailing-cr > fail
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...