-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_all.sh
More file actions
executable file
·54 lines (49 loc) · 927 Bytes
/
test_all.sh
File metadata and controls
executable file
·54 lines (49 loc) · 927 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
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
#!/usr/bin/env bash
set -e
# Filter out comment lines, then pipe into redis-cli:
sed '/^#/d' << 'EOF' | redis-cli -p 6379
# 1) Start clean
FLUSHALL
# 2) Common Commands
PING
ECHO Hello
# 3) Key/Value Operations
SET mykey myvalue
GET mykey
KEYS *
TYPE mykey
DEL mykey
SET session1 foo
EXPIRE session1 1
GET session1 # after ~1s should return (nil)
RENAME session1 session2
GET session2
# 4) List Operations
RPUSH mylist a b c
LGET mylist
LLEN mylist
LPUSH mylist start
RPUSH mylist end
LPOP mylist
RPOP mylist
RPUSH mylist x y x z x
LREM mylist 2 x
LREM mylist 0 x
LINDEX mylist 1
LINDEX mylist -1
LSET mylist 1 new_val
LGET mylist
# 5) Hash Operations
HSET user:1 name Alice age 30 email alice@example.com
HGET user:1 email
HEXISTS user:1 address
HEXISTS user:1 name
HDEL user:1 age
HEXISTS user:1 age
HLEN user:1
HKEYS user:1
HVALS user:1
HGETALL user:1
HMSET user:2 name Bob age 25 city Paris
HGETALL user:2
EOF