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

segsearch.sh 2.1 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
  1. #!/usr/bin/env bash
  2. # Test the gmtconvert -Q search option for all possibilities
  3. cat << EOF > data.txt
  4. > This is just junk
  5. -9 -9
  6. -9 -9
  7. > -L"Segment 100-A"
  8. 0 0
  9. 1 1
  10. > -L"Segment 100-B"
  11. 0 0
  12. 1 1
  13. > -L"Segment 110-A"
  14. 0 0
  15. 1 1
  16. > -L"Segment 110-B"
  17. 0 0
  18. 1 1
  19. > -L"Segment 120-A"
  20. 0 0
  21. 1 1
  22. > -L"Segment 120-B"
  23. 0 0
  24. 1 1
  25. EOF
  26. rm -f fail
  27. # 1. This test should yield answer1.txt
  28. cat << EOF > answer1.txt
  29. > This is just junk
  30. -9 -9
  31. -9 -9
  32. EOF
  33. gmt convert data.txt -Sjunk > result1.txt
  34. diff answer1.txt result1.txt >> fail
  35. # 2. This test should yield answer2.txt
  36. cat << EOF > answer2.txt
  37. > -L"Segment 100-A"
  38. 0 0
  39. 1 1
  40. > -L"Segment 100-B"
  41. 0 0
  42. 1 1
  43. > -L"Segment 110-A"
  44. 0 0
  45. 1 1
  46. > -L"Segment 110-B"
  47. 0 0
  48. 1 1
  49. > -L"Segment 120-A"
  50. 0 0
  51. 1 1
  52. > -L"Segment 120-B"
  53. 0 0
  54. 1 1
  55. EOF
  56. gmt convert data.txt -S~junk > result2.txt
  57. diff answer2.txt result2.txt >> fail
  58. # 3. This test should yield answer3.txt
  59. cat << EOF > answer3.txt
  60. > -L"Segment 100-A"
  61. 0 0
  62. 1 1
  63. > -L"Segment 100-B"
  64. 0 0
  65. 1 1
  66. > -L"Segment 120-A"
  67. 0 0
  68. 1 1
  69. > -L"Segment 120-B"
  70. 0 0
  71. 1 1
  72. EOF
  73. gmt convert data.txt -S/"Segment 1[02]0"/ > result3.txt
  74. diff answer3.txt result3.txt >> fail
  75. # 4. This test should yield answer4.txt
  76. cat << EOF > answer4.txt
  77. > -L"Segment 100-B"
  78. 0 0
  79. 1 1
  80. > -L"Segment 120-B"
  81. 0 0
  82. 1 1
  83. EOF
  84. gmt convert data.txt -S/"Segment 1[02]0-B"/ > result4.txt
  85. diff answer4.txt result4.txt >> fail
  86. # 5. This test should yield answer5.txt
  87. cat << EOF > answer5.txt
  88. > This is just junk
  89. -9 -9
  90. -9 -9
  91. > -L"Segment 100-A"
  92. 0 0
  93. 1 1
  94. > -L"Segment 110-A"
  95. 0 0
  96. 1 1
  97. > -L"Segment 110-B"
  98. 0 0
  99. 1 1
  100. > -L"Segment 120-A"
  101. 0 0
  102. 1 1
  103. EOF
  104. gmt convert data.txt -S~/"Segment 1[02]0-B"/ > result5.txt
  105. diff answer5.txt result5.txt >> fail
  106. cat << EOF > list
  107. /"Segment 1[02]0-B"/
  108. junk
  109. EOF
  110. # 6. This test should yield answer6.txt
  111. cat << EOF > answer6.txt
  112. > -L"Segment 100-A"
  113. 0 0
  114. 1 1
  115. > -L"Segment 110-A"
  116. 0 0
  117. 1 1
  118. > -L"Segment 110-B"
  119. 0 0
  120. 1 1
  121. > -L"Segment 120-A"
  122. 0 0
  123. 1 1
  124. EOF
  125. gmt convert data.txt -S~+flist > result6.txt
  126. diff answer6.txt result6.txt >> fail
  127. # 7. This test should yield answer7.txt
  128. cat << EOF > answer7.txt
  129. > This is just junk
  130. -9 -9
  131. -9 -9
  132. > -L"Segment 100-B"
  133. 0 0
  134. 1 1
  135. > -L"Segment 120-B"
  136. 0 0
  137. 1 1
  138. EOF
  139. gmt convert data.txt -S+flist > result7.txt
  140. diff answer7.txt result7.txt >> fail
Tip!

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

Comments

Loading...