Giter VIP home page Giter VIP logo

Comments (2)

gregelin avatar gregelin commented on July 17, 2024

Also small differences between RHEL and Fedora:

Fedora

yum install openscap openscap-utils openscap-content -y

RHEL

yum install openscap openscap-utils -y

as per http://www.open-scap.org/page/Download

from govready.

gregelin avatar gregelin commented on July 17, 2024

My plan is to use simple if/then/elif/else/fi statements within each function to manage different platforms.

The thinking comes from http://blog.backblaze.com/2008/12/15/10-rules-for-how-to-write-cross-platform-code/ which describes 10 rules for cross platform development, including don't port and using basic libraries. Although this approach violates the DRY (Do Not Repeat Yourself), it is also less simpler and more robust for each function to have its own checks. Some will feel this redundancy increases likelihood of error. The benefits, however, are that there will be reduced need to trace a function back to a variable; easier to hold code in the head; easier to deal with other special cases of the commands that come up; and easier to test and separate the code into multiple files later on.

example code (Probably I want to not set a variable but to execute actual command):

if which yum; then
        INSTALL="yum"
elif which apt-get; then
        INSTALL="apt-get"
else
        INSTALL="not defined"
fi
printf "command is ${INSTALL}\n"

from govready.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.