node-nikita
node-nikita copied to clipboard
add grep options on @execute
We often use bash grep to check output of a command, and return 1 (mecano fail) if not found. Works great, but we loose the output of the firt command.
@execute
cmd: 'ps aux | grep toto'
, (err, out, err) -> //out contains toto if found, else is empty
Solution could be:
@execute
cmd: 'ps aux'
grep: 'toto'
, (err, out, err) -> //out contains ps aux output
Also , would support regexp :
@execute
cmd: 'ps aux'
grep: /t.to/
, (err, out, err) -> //out contains ps aux output