Skip to content

Commit 1cb3a83

Browse files
committed
integrate a note from misc into the i/o section
1 parent 57a33ad commit 1cb3a83

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

02-io/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,14 @@ $ cat cowsaid | singularity exec lolcow.simg cowsay -n
5858
```
5959

6060
We've created a meta-cow (a cow that talks about cows). :stuck_out_tongue_winking_eye:
61+
62+
63+
So pipes and redirects work as expected between a container and the host system.
64+
if, however, you need to pipe the output of one command in your container to another command in your container, things are slightly more complicated.
65+
Pipes and redirects are shell constructs, so if you don't want your host shell to interpret them, you have to hide them from it.
66+
67+
```
68+
$ singularity exec lolcow.img sh -c "fortune | cowsay | lolcat"
69+
```
70+
71+
The above invokes a new shell, but inside the container, and tells it to run the single command line `fortune | cowsay | lolcat`.

06-misc/README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
## Miscellaneous Topics
22

3-
### pipes and redirection
4-
5-
As we demonstrated earlier, pipes and redirects work as expected between a container and host system. If you need to pipe the output of one command in your container to another command in your container things are slightly more complicated.
6-
7-
```
8-
$ singularity exec lolcow.img sh -c "fortune | cowsay | lolcat"
9-
```
10-
113
### X11 and OpenGL
124

135
You can use Singularity containers to display graphics through common protocols. To do this, you need to install the proper graphics stack within the Singularity container. For instance if you want to display X11 graphics you must install `xorg` within your container. In an Ubuntu container the command would look like this.

0 commit comments

Comments
 (0)