Parses a command line into the commands of its list, without their conditions: for a caller that looks at every command a line holds. Respects quoted strings: a joiner inside quotes is not a separator.
The full command line.
An array of individual commands.
semicolons_parse("ls; pwd") // Returns: ["ls", "pwd"]semicolons_parse("echo 'a;b'; pwd") // Returns: ["echo 'a;b'", "pwd"]semicolons_parse("cd /tmp && ls; cat file.txt") // Returns: ["cd /tmp", "ls", "cat file.txt"] Copy
semicolons_parse("ls; pwd") // Returns: ["ls", "pwd"]semicolons_parse("echo 'a;b'; pwd") // Returns: ["echo 'a;b'", "pwd"]semicolons_parse("cd /tmp && ls; cat file.txt") // Returns: ["cd /tmp", "ls", "cat file.txt"]
Parses a command line into the commands of its list, without their conditions: for a caller that looks at every command a line holds. Respects quoted strings: a joiner inside quotes is not a separator.