Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We have a following directory structure:

Code Block
themeMidnight
./
../
cm_shell.sh
cm-shell-1.3.0-RELEASE-exec.jar
script.txt

The contents of script.txt are following:

Midnight
Code Block
theme
login --server https://secure.clevermaps.io
openProject --project abcdefgh12345678
loadCsv --file /home/user/CAN/orders.csv --dataset orders --mode incremental
loadCsv --file /home/user/CAN/customers.csv --dataset customers --mode incremental
dumpCsv --dataset stores
exit

By default, the running script (in this case can_shell.sh) does not containt the --cmdfile argument. So unless you add it there, you will have to run the Shell like this:

Midnight
Code Block
theme
java -jar cm-shell-1.3.0-RELEASE-exec.jar --cmdfile script.txt

If the script file exists and is valid, it is executed.

Exit code

Shell supports classic exit code behavior.

...

This is usable in automated environments, combining with other scripts, etc.

_