Shell-tools: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 68: Line 68:
export PATH=~/bin/shell-tools:${PATH}
export PATH=~/bin/shell-tools:${PATH}
</syntaxhighlight>
</syntaxhighlight>
=lib=
Contains <code>bash.shlib</code>, <code>java.shlib</code>, etc.
==lib Usage==
Each library, when sourced, sets to true an environment variable composed by uppercasing the name of the library. In bash.shlib case, its BASH_SHLIB=true.
Any other library that needs bash.shlib must not source it, but do this instead:
<syntaxhighlight lang='bash'>
${BASH_SHLIB} || { echo "bash.shlib was not sourced" 1>&2; exit 1; }
</syntaxhighlight>
Only the top level scripts should source libraries.


=TODO=
=TODO=


{{Internal|shell-tools TODO|shell-tools TODO}}
{{Internal|shell-tools TODO|shell-tools TODO}}

Revision as of 00:03, 23 November 2019

Internal

Overview

A collection of ready-to-use command line tools. Includes searchjar, setw/cdw, lims, etc. Can be used both on Linux and Cygwin systems.

Configure a Script to Use the Libraries

#!/usr/bin/env bash

[[ -z "${SHLIB_DIR}" ]] && { echo "[error]: SHLIB_DIR not defined" 1>&2; exit 1; }
[[ -f ${SHLIB_DIR}/std.shlib ]] && . ${SHLIB_DIR}/std.shlib || { echo "[error]: ${SHLIB_DIR}/std.shlib not found" 1>&2; exit 1; }

std.shlib

TODO

On 04/04/16 a standalone std.shlib project was created. At that time, em contained its own version of std.shlib. Must migrate em to use the separated one. See std.shlib.

GitHub

https://github.com/NovaOrdis/shell-tools

To clone:

git clone git@github.com:NovaOrdis/shell-tools.git

Tools

  • cdw/getw
  • searchjar
  • rename-intellij
  • lims
  • mac-setup
  • b, t, d, r

Installation

    cd ~/bin
    git clone git@github.com:NovaOrdis/shell-tools.git

Alternatively, read only access is available for an arbitrary Git account:

    git clone https://<git-account>@github.com/NovaOrdis/shell-tools.git

Then edit ~/.bashrc as follows:

...

# 
# shell-tools
# 
alias cdw='. cdwi'
export PATH=~/bin/shell-tools:${PATH}

lib

Contains bash.shlib, java.shlib, etc.

lib Usage

Each library, when sourced, sets to true an environment variable composed by uppercasing the name of the library. In bash.shlib case, its BASH_SHLIB=true.

Any other library that needs bash.shlib must not source it, but do this instead:

${BASH_SHLIB} || { echo "bash.shlib was not sourced" 1>&2; exit 1; }

Only the top level scripts should source libraries.

TODO

shell-tools TODO