Closed gnanet closed 4 years ago
The more simple way for creating a hello.js is to use here-doc syntax, and avoid to instruct the user to enter some control+key stuff:
Instead of this:
The bash command below prompts the user to enter a code snippet to be saved in "hello.js". Press <enter> after the closing } and then either ^D or ^C to finish the prompt.
The bash command below prompts the user to enter a code snippet to be saved in "hello.js".
Press <enter> after the closing } and then either ^D or ^C to finish the prompt.
<enter>
}
$ cat > hello.js const hello = 'world'; for (let i = 0; i < hello.length; i++) { console.log(hello[i]); } ^D
That paragraph could be this:
The bash command below creates a code snippet saved as "hello.js".
Simply copy + paste the code starting with cat, including the EOT on the last line, and press <enter>.
$ cat <<EOT > hello.js const hello = 'world'; for (let i = 0; i < hello.length; i++) { console.log(hello[i]); } EOT
Nice addition, feel free to make PR with this 👍
Thanks a lot :), landed to v6.0.0 🎉 .
@coderaiser oh shit, i created a PR on my fork from the change-branch to the master :man_facepalming:
myfault
The more simple way for creating a hello.js is to use here-doc syntax, and avoid to instruct the user to enter some control+key stuff:
Instead of this:
That paragraph could be this:
The bash command below creates a code snippet saved as "hello.js".
Simply copy + paste the code starting with cat, including the EOT on the last line, and press
<enter>
.