-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path#catscript.bash#
45 lines (37 loc) · 1.21 KB
/
#catscript.bash#
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
# !/bin/bash
#This is a comment. This is another comment
PUBLISHED=/anfs/www/html/meters/elec/published
echo $PUBLISHED
echo "{
\"item-metadata\":[
{
\"rel\":\"urn:X-tsbiot:rels:isContentType\",
\"val\":\"application/vnd.tsbiot.catalogue+json\"
},
{
\"rel\":\"urn:X-tsbiot:rels:hasDescription:en\",
\"val\":\"Sensor Data\"
},
{
\"rel\":\"urn:X-tsbiot:rels:supportsSearch\",
\"val\":\"urn:X-tsbiot:search:simple\"
}
],
\"items\":[
" > text.json
for meter in $PUBLISHED/*; do
echo " {
\"href\":\"http://www.cl.cam.ac.uk/meters/elec/published/$me(basename $met)\",
\"i-object-metadata\":[
{
\"rel\":\"urn:X-tsbiot:rels:isContentType\",
\"val\":\"application/json\"
},
{
\"rel\":\"urn:X-tsbiot:hasDescription:en\"
\"val\":\"$(basename $meter)\"
}
]
},
" >> text.json
done