Skip to content

Commit 6822188

Browse files
Mirror notes
Signed-off-by: Christopher Hakkaart <[email protected]>
1 parent aac6dfe commit 6822188

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

docs/process.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ To use a language other than Bash, start your process script with the correspond
8989
```nextflow
9090
process perlTask {
9191
"""
92-
#!/usr/bin/perl
92+
#!/usr/bin/env perl
9393
9494
print 'Hi there!' . '\n';
9595
"""
9696
}
9797
9898
process pythonTask {
9999
"""
100-
#!/usr/bin/python
100+
#!/usr/bin/env python
101101
102102
x = 'Hello'
103103
y = 'world!'
@@ -112,10 +112,10 @@ workflow {
112112
```
113113

114114
:::{tip}
115-
As the location of the interpreter binary file can differ across platforms. Use the `env` command followed by the interpreter name to make your script more portable. For example:
115+
As the location of the interpreter binary file can differ across platforms. Use `env` to resolve the interpreter's location instead of hard-coding the interpreter path. For example:
116116

117-
```nextflow
118-
#!/usr/bin/env perl
117+
```
118+
#!/usr/bin/env python
119119
```
120120

121121
:::

docs/sharing.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,16 @@ Executable scripts can be included in the pipeline `bin` directory located at th
105105
└── main.nf
106106
```
107107

108-
Each script should include a shebang line to specify the interpreter for the script. To maximize portability, use `env` to dynamically resolve the interpreter's location instead of hard-coding the interpreter path.
108+
Each script should include a shebang line to specify the interpreter for the script.
109109

110-
For example, the shebang definitions `#!/usr/bin/python` and `#!/usr/local/bin/python` hard-code specific paths to the Python interpreter. Use `#!/usr/bin/env python` instead.
110+
:::{tip}
111+
As the location of the interpreter binary file can differ across platforms. Use `env` to resolve the interpreter's location instead of hard-coding the interpreter path. For example:
112+
113+
```
114+
#!/usr/bin/env python
115+
```
116+
117+
:::
111118

112119
Scripts placed in the `bin` directory must have executable permissions. Use the `chmod` command to grant the required permissions. For example:
113120

0 commit comments

Comments
 (0)