atom-community / atom-community/atom-script

Bash: incorrect program arguments when running selection of code

Open
#1,192 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
730
Forks
264
PR merge metrics
No merged PRs in 30d

Description

Test code:

```bash
#!/bin/bash

set -o errexit
set -o nounset

echo $0
echo $1
echo $2
```

Steps to reproduce:

1. Configure to run with program arguments "foo bar"
2. Run the script with no code selected and verify that the output is correct:
```
/path/to/test.sh
foo
bar
```
3. Select the entire code, run and verify the error is present:
```
foo
bar
foo: line 15: $2: unbound variable
```

Versions:

Atom: 1.12.7 (Debian Sid)
Script: 3.13.0

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.