google / google/styleguide

Shell style for multi-stage pipeline with heredoc

Open
#632 0 comments 0 reactions 0 assignees View on GitHub
lang:shell
Dominant language
HTML
Stars
39.6k
Forks
12.9k
Avg merge
42m
Merged PRs (30d)
15

Description

Please update the Shell Style guide to indicate which of the following 3 approaches for a multi-stage pipeline with heredoc is recommended:

### Approach 1

```bash
cat <<'EOF' \
| cat \
| cat \
| cat
hello
EOF
```

### Approach 2

```bash
cat <<'EOF' |
hello
EOF
cat \
| cat \
| cat
```

### Approach 3

```bash
(
cat \
| cat \
| cat \
| cat
) <<'EOF'
hello
EOF
```

Discussion: https://stackoverflow.com/questions/7046381

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.