-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample1
More file actions
executable file
·27 lines (19 loc) · 764 Bytes
/
example1
File metadata and controls
executable file
·27 lines (19 loc) · 764 Bytes
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
#!/usr/bin/awk -f
# simple demonstration of redis.awk API
@include "redis.awk"
BEGIN {
# redis = redis_open("redis.hello.org", 6379)
ctx = redis_open() # Use env. variable REDIS_ENDPOINT or
# the default, "localhost:6379"
print "CONTEXT: ", ctx
redis_command(ctx, resp, 3, "SET", "name", "Seong-Kook Shin")
redis_command(ctx, resp, 8, "HMSET", "pet",
"name", "Ping",
"age", 3,
"species", "lovebird")
redis_command(ctx, resp, 2, "GET", "name")
redis_dump(resp) # Dump the response to stderr
redis_command(ctx, resp, 2, "HGETALL", "pet")
redis_dump(resp) # Dump the response to stderr
redis_close(ctx)
}