Skip to content

Commit fa69e68

Browse files
committed
Add better example to demonstrate multi-dir merging
1 parent 6e4cbe0 commit fa69e68

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,22 +158,20 @@ explore /tmp/tmp.X6OQb5tJwr` to explore an existing sandbox.
158158
To specify multiple lower directories for overlay (by merging them together), you can use the `-L` flag followed by a colon-separated list of directories. The directories on the left have higher precedence and can overwrite the directories on the right:
159159

160160
```ShellSession
161-
$ try -D rustup-sandbox "curl https://sh.rustup.rs > rustup.sh"
161+
$ try -D sandbox1 "echo 'File 1 Contents - sandbox1' > file1.txt"
162162
...
163-
$ try -L rustup-sandbox "sh rustup.sh"
164-
165-
Changes detected in the following files:
166-
167-
rustup-sandbox//upperdir/home/ubuntu/.profile (modified/added)
168-
rustup-sandbox//upperdir/home/ubuntu/.bashrc (modified/added)
169-
rustup-sandbox//upperdir/home/ubuntu/.rustup/update-hashes/stable-x86_64-unknown-linux-gnu (modified/added)
163+
$ try -D sandbox2 "echo 'File 2 Contents - sandbox2' > file2.txt"
164+
...
165+
$ try -D sandbox3 "echo 'File 2 Contents - sandbox3' > file2.txt"
170166
...
171167

172-
Commit these changes? [y/N] y
173-
168+
# Now use the -L flag to merge both sandbox directories together, with sandbox3 having precedence over sandbox2
169+
$ try -L "sandbox3:sandbox2:sandbox1" "cat file1.txt file2.txt"
170+
File 1 Contents - sandbox1
171+
File 2 Contents - sandbox3
174172
```
175173

176-
In this example, `try`` will merge `/lowerdir1`, `/lowerdir2` and `/lowerdir3` together before mounting the overlay. This way, you can combine the contents of multiple `try` sandboxes .
174+
In this example, `try` will merge `/sandbox1`, `/sandbox2` and `/sandbox3` together before mounting the overlay. This way, you can combine the contents of multiple `try` sandboxes.
177175

178176

179177
## Known Issues

0 commit comments

Comments
 (0)