Skip to content

Commit

Permalink
Fix bash error in usage example on README page (#943)
Browse files Browse the repository at this point in the history
* Fix bash error in usage example on README page

On Linux bash terminal, executing
`echo "console.log('Hello, world!')"`
gives the following error:
`bash: !': event not found`

To fix the issue, changing the log string from
`Hello, world!` to `Hello, world`

Tested on following systems:
* Ubuntu 18.04.3 LTS
* Linux Mint 19

* Switching the quotes to keep the exclamation mark

Switching the quotes around in the line
`echo "console.log('Hello, world!')" | ts-node`
to get the line as
`echo 'console.log("Hello, world!")' | ts-node`
in order to keep the exclamation mark, while also
avoiding the bash error at the same time.
  • Loading branch information
abraj committed Feb 15, 2020
1 parent 5b5ae91 commit 3eb46e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -37,7 +37,7 @@ ts-node -e 'console.log("Hello, world!")'
ts-node -p -e '"Hello, world!"'

# Pipe scripts to execute with TypeScript.
echo "console.log('Hello, world!')" | ts-node
echo 'console.log("Hello, world!")' | ts-node
```

![TypeScript REPL](https://github.com/TypeStrong/ts-node/raw/master/screenshot.png)
Expand Down

0 comments on commit 3eb46e0

Please sign in to comment.