abs-lang / abs

Home of the ABS programming language: the joy of shell scripting.
https://www.abs-lang.org
MIT License
510 stars 35 forks source link

Ability to read command output line by line in a loop #475

Open gustavosbarreto opened 2 years ago

gustavosbarreto commented 2 years ago

NOTE: the command need to be executed in the background.

for line in `tail -f /tmp/log &` {
  echo(line)
}

Also combines the stdout and stderr of executed command in the same ouput, like native Go implementation of cmd.CombinedOutput.