Skip to content

Commit

Permalink
Merge pull request #10513 from jutley/txn-newline-documentation
Browse files Browse the repository at this point in the history
etcdctl: Update README to clarify newline syntax in TXN
  • Loading branch information
xiang90 authored Mar 2, 2019
2 parents a943ad0 + a532b60 commit 2c69559
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions etcdctl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,27 @@ put key2 "some extra key"
# OK
```

#### Remarks

When using multi-line values within a TXN command, newlines must be represented as `\n`. Literal newlines will cause parsing failures. This differs from other commands (such as PUT) where the shell will convert literal newlines for us. For example:

```bash
./etcdctl txn <<<'mod("key1") > "0"
put key1 "overwrote-key1"
put key1 "created-key1"
put key2 "this is\na multi-line\nvalue"
'

# FAILURE

# OK

# OK
```

### COMPACTION [options] \<revision\>

COMPACTION discards all etcd event history prior to a given revision. Since etcd uses a multiversion concurrency control
Expand Down

0 comments on commit 2c69559

Please sign in to comment.