javascript-terminal icon indicating copy to clipboard operation
javascript-terminal copied to clipboard

shell scripts

Open adamwong246 opened this issue 5 years ago • 1 comments

Whats the best way to run a series of commands a la a shell script?

adamwong246 avatar Mar 16 '20 16:03 adamwong246

Given the scope of this project, unfortunately, there's not nice way to run a script of commands.

The command parser does support the && operator to chain commands, like echo "a" && echo "b".

Here's how I would approach this problem:

  1. Before calling emulator.execute, do your own parsing of commandStr to check if it should be run as a series of commands
  2. If so, chain the commands with && then call emulator.execute

Hope that helps!

rohanchandra avatar Apr 04 '20 07:04 rohanchandra