Menu

Updates to exit with error codes from linuxsupport scripts

2023-09-27
2023-09-29
  • Edward A Soard

    Edward A Soard - 2023-09-27

    Just some small changes to the linux support .sh scripts

    What I did :
    At the end of the scripts where $? is checked for errors, I stored $? in a variable named $EXITCODE. the $EXITCODE is checked for its value and if it isn't 0 the error routine is run, then the script exits passing the value of $EXITCODE. The value is stored because 'echo' itself is a command and once it is run, $? wil take the value of echo's exit code. Storing the exit code of the program we are interested in allows us to pass the code back to the operating system.

    Why:
    There are multiple constructs to run multiple programs on a single command line. The most common are ';' and '&&'

    makehex.sh sourcefile.gcb; anothercommand

    will run anothercommand immadiately after running makehex.sh

    makehex.sh sourcefile.gcb && anothercommand

    will run anothercommand only if makehex.sh doesn't exit with an error such as a compiler error.

     
  • Anobium

    Anobium - 2023-09-27

    Edward - thank you.

    I have added these scripts to the Gold Build.

    I have also 'has a go' at adding your post ( above ) to the Help. Can you review/edit the Help page ? https://github.com/GreatCowBASIC/Help/blob/main/source/linuxoverview.adoc You may want to add you insights ( re the $EXITCODE ) to the Help, if you wish. I may have got help incorrect, so forgive me, and hack away! See sectionn === Make ASM, Make HEX and Programming Operations using the provided Linux scripts on the ADOC page.

     
  • Edward A Soard

    Edward A Soard - 2023-09-29

    Help page looks good. Thank you!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.