You can pass a sequence of commands into the dspace command-line tool using the read command.

Execute commands...this way
...from a file[dspace]/bin/dspace read a-command-file
...in a pipeline

some-other-command | [dspace]/bin/dspace read -

some-other-command | [dspace]/bin/dspace read


The command script (a-command-file in the example above) should contain one command per line, without the '/bin/dspace'.  For example:

user --add --email john@example.com --password secret1
user --add --email marsha@example.com --password secret2