You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/process.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,6 +212,10 @@ Template scripts are generally discouraged due to the caveats described above. T
212
212
213
213
### Shell
214
214
215
+
:::{deprecated} 24.11.0-edge
216
+
Use the `script` block instead. Consider using the {ref}`VS Code extension <vscode-page>`, which provides syntax highlighting and error checking to distinguish Nextflow variables from Bash variables in the process script.
217
+
:::
218
+
215
219
The `shell` block is a string expression that defines the script that is executed by the process. It is an alternative to the {ref}`process-script` definition with one important difference: it uses the exclamation mark `!` character, instead of the usual dollar `$` character, to denote Nextflow variables.
216
220
217
221
This way, it is possible to use both Nextflow and Bash variables in the same script without having to escape the latter, which makes process scripts easier to read and maintain. For example:
Copy file name to clipboardExpand all lines: docs/reference/syntax.md
+7-16Lines changed: 7 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,7 @@ process sayHello {
187
187
}
188
188
```
189
189
190
-
A process may define additional sections for *directives*, *inputs*, *outputs*, *script*, *shell*, *exec*, and *stub*:
190
+
A process may define additional sections for *directives*, *inputs*, *outputs*, *script*, *exec*, and *stub*:
191
191
192
192
```nextflow
193
193
process greet {
@@ -202,7 +202,7 @@ process greet {
202
202
output:
203
203
stdout
204
204
205
-
script: // or shell: or exec:
205
+
script: // or exec:
206
206
"""
207
207
echo '${greeting}, ${name}!'
208
208
"""
@@ -214,27 +214,17 @@ process greet {
214
214
}
215
215
```
216
216
217
-
- A process must define a script, shell, or exec section (see below). All other sections are optional. Directives do not have an explicit section label, but must be defined first.
217
+
- A process must define a script or exec section (see below). All other sections are optional. Directives do not have an explicit section label, but must be defined first.
218
218
219
219
- The `script:` section label can be omitted only when there are no other sections in the body.
220
220
221
221
- Sections must be defined in the order shown above, with the exception of the output section, which can also be specified after the script and stub.
222
222
223
223
Each section may contain one or more statements. For directives, inputs, and outputs, these statements must be [function calls](#function-call). See {ref}`process-reference` for the set of available input qualifiers, output qualifiers, and directives.
224
224
225
-
The script section can be substituted with a shell or exec section:
225
+
The script section can be substituted with an exec section:
226
226
227
227
```nextflow
228
-
process greetShell {
229
-
input:
230
-
val greeting
231
-
232
-
shell:
233
-
'''
234
-
echo '!{greeting}, ${USER}!'
235
-
'''
236
-
}
237
-
238
228
process greetExec {
239
229
input:
240
230
val greeting
@@ -248,7 +238,7 @@ process greetExec {
248
238
}
249
239
```
250
240
251
-
The script, shell, and stub sections must return a string in the same manner as a [function](#function).
241
+
The script and stub sections must return a string in the same manner as a [function](#function).
252
242
253
243
See {ref}`process-page` for more information on the semantics of each process section.
254
244
@@ -356,7 +346,7 @@ Variables declared in a function, as well as the parameters of that function, ex
356
346
357
347
Workflow inputs exist for the entire workflow body. Variables declared in the main section exist for the main, emit, and publish sections. Named outputs are not considered variable declarations and therefore do not have any scope.
358
348
359
-
Process input variables exist for the entire process body. Variables declared in the process script, shell, exec, and stub sections exist only in their respective section, with one exception -- variables declared without the `def` keyword also exist in the output section.
349
+
Process input variables exist for the entire process body. Variables declared in the process script, exec, and stub sections exist only in their respective section, with one exception -- variables declared without the `def` keyword also exist in the output section.
360
350
361
351
Variables declared in an if or else branch exist only within that branch:
362
352
@@ -958,4 +948,5 @@ The following legacy features were excluded from this page because they are depr
958
948
959
949
- The `addParams` and `params` clauses of include declarations. See {ref}`module-params` for more information.
960
950
- The `when:` section of a process definition. See {ref}`process-when` for more information.
951
+
- The `shell:` section of a process definition. See {ref}`process-shell` for more information.
961
952
- The implicit `it` closure parameter. See {ref}`script-closure` for more information.
Copy file name to clipboardExpand all lines: docs/vscode.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
(vscode-page)=
1
2
2
3
# VS Code integration
3
4
@@ -443,6 +444,10 @@ The `each` process input is deprecated. Use the `combine` or `cross` operator to
443
444
444
445
The process `when` section is deprecated. Use conditional logic, such as an `if` statement or the `filter` operator, to control the process invocation in the calling workflow.
445
446
447
+
**Process shell section**
448
+
449
+
The process `shell` section is deprecated. Use the `script` block instead. The VS Code extension provides syntax highlighting and error checking to help distinguish between Nextflow variables and Bash variables.
450
+
446
451
### Configuration syntax
447
452
448
453
See {ref}`config-syntax` for a comprehensive description of the configuration language.
0 commit comments