Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Introduction

JS7 offers a number of JS7 - Job TypesClasses including JS7 - Java JobsJS7 - JavaScript Jobs and Shell Jobs.

...

Code Block
languagepowershell
titleExample how run PowerShell® script code with a shebang replacement
linenumberstrue
@@setlocal enabledelayedexpansion & @@findstr/v \"^@@f^@@[fs].*&\" \"%~f0\" | powershell.exe -NonInteractive -Command -&goto:eof & exit !errorlevel!/b&

Write-Output "Hello" 
Write-Output "world" 

...

Code Block
languagepy
titleExample how use Python script code with a shebang
linenumberstrue
@@setlocal enabledelayedexpansion & @@findstr/v \"^@@f^@@[fs].*&\" \"%~f0\" | python.exe -&goto:eof & exit !errorlevel!/b&

print("Hello")
print("world")

...

Code Block
languagejs
titleExample how run Node.js® script code with a shebang replacement
linenumberstrue
@@setlocal enabledelayedexpansion & @@findstr/v \"^@@f^@@[fs].*&\" \"%~f0\" | node.exe -&goto:eof & exit !errorlevel!/b&

var name = (process.env.name);
var num = parseInt(process.env.num);

console.log(name);
console.log(num);

...

Code Block
languagejs
titleExample for passing variables from a Node.js job script
linenumberstrue
#!/usr/bin/node

const fs = require('fs');

var someVar = Math.random();
fs.appendFile(process.env.JS7_RETURN_VALUES, 'my_var=' + someVar + '\n', (err) => {});

...