Project Description

Scope of this project is to implement a simple include feature (similar to #include of the C-precompiler or import of python), for generic text files. See below section Additional improvements too, on ifdef define .

A command based not on programming languages, but shell script, able to "insert" in specific lines of text files another needed text saved in external files, kept in separated files/folders, so improving critical values confidentiality or improving reusability of text, centralizing the changes in those separated files, that can be then reintegrated/expanded with the full text just before the use or at runtime.

As use case i.e., this could be used in pure yaml files (not accompanied by any standard include feature) to separate from a text body some secret values or some code lines equally repeated in many text-bodies.

Similarly for JSON or a Dockerfile or Markdown or any text or source code file.

Interest for this project is the need to improve text files management in Linux also with no language installed and when not allowed by the text-type standar syntax, making easier reusability of repeated groups of lines and/or reducing eventual exposure of specific values, centralizing the updates in separated files and folders.

Goal for this Hackweek

Main goal is to implement as Linux shell script a draft first verion of such feature and provide some examples.

Additional improvements while hacking

The full project has been renamed from "import in a text file..." to the current title, having been improved with DEFINE IFDEF ENDIF INCLUDE verbs preprocessing, in the cpp style, able to implement text changes based on expressions other than include external text files, now much more being a Generic Text Preprocessor.
INCLUDE works also with files from http urls.
Pls in Resources, see prepro folder and README documentation descriptions.

Resources

Code, documentation and tests, see in:

  • https://gitlab.suse.de/mdati/hack-wk
    • branch [main]

This project is part of:

Hack Week 23

Activity

  • about 1 year ago: mdati added keyword "ifdef" to this project.
  • about 1 year ago: mdati added keyword "preprocessor" to this project.
  • about 1 year ago: AZhou liked this project.
  • about 1 year ago: mdati liked this project.
  • about 1 year ago: mdati started this project.
  • about 1 year ago: mdati removed keyword #confidentiality from this project.
  • about 1 year ago: mdati removed keyword #reusability from this project.
  • about 1 year ago: mdati removed keyword #import from this project.
  • about 1 year ago: mdati removed keyword #include from this project.
  • about 1 year ago: mdati added keyword "include" to this project.
  • about 1 year ago: mdati added keyword "import" to this project.
  • about 1 year ago: mdati added keyword "reusability" to this project.
  • about 1 year ago: mdati added keyword "confidentiality" to this project.
  • about 1 year ago: mdati added keyword "textfile" to this project.
  • about 1 year ago: mdati added keyword "asciidoc" to this project.
  • about 1 year ago: mdati added keyword "linux" to this project.
  • about 1 year ago: mdati added keyword "bash" to this project.
  • about 1 year ago: mdati added keyword "#include" to this project.
  • about 1 year ago: mdati added keyword "#import" to this project.
  • about 1 year ago: mdati added keyword "#reusability" to this project.
  • about 1 year ago: mdati added keyword "#confidentiality" to this project.
  • about 1 year ago: mdati originated this project.

  • Comments

    • mdati
      12 months ago by mdati | Reply

      The version 1 of the preprocessor with documentation, validation and examples is ready available in the named gitlab repo. Consider that, on the contrary of cpp expecting C syntax, with warnings when used for non-C types, this tool is generic-text oriented, with other features and could still be customized/extended more (e.g. import from remote URL)

    Similar Projects

    Contributing to Linux Kernel security by pperego

    Description

    A couple of weeks ago, I foun...


    Fundamental Linux Security and Practice by r1chard-lyu

    Description

    This project focuses on discove...


    toptop - a top clone written in Go by dshah

    Description

    toptop is a clone of Linux's ...


    Testing and adding GNU/Linux distributions on Uyuni by juliogonzalezgil

    Join the Gitter channel! [https://gitter.im/uy...


    Testing and adding GNU/Linux distributions on Uyuni by juliogonzalezgil

    Join the Gitter channel! [https://gitter.im/uy...