DEV Community

Bret
Bret

Posted on

Terminal Comand... to write code “inside” a file.JS file... how do you do that?

What is the terminal code to write “INSIDE” of a test.JS file?

Top comments (4)

Collapse
 
fullzero5 profile image
FullZero • Edited
echo "export const MyName = () => console.log('Myname = name')" > app.js
Enter fullscreen mode Exit fullscreen mode
Collapse
 
yobretyo profile image
Bret

It won’t let me put that into a “task” because it uses “” more then what’s allowed in a row.

Collapse
 
fullzero5 profile image
FullZero

I don't quite understand the context “task” - maybe you need to escape characters

Collapse
 
weirdmayo profile image
Daniel Mayovsky

By task do you mean cron task or something?
Just put that into a shell script and execute it instead