Suppose I have a js file (which can be executed using node
):
process.stdout.write('Test')
Is there any way I can use this in a bash file? For example, to set the PS1
?
Here is what I tried:
#!/usr/bin/env bash
get_output() {
return node path/to/file.js
}
export PS1='$ $get_output >'
I'm pretty sure this shows you I am a bash newbie...