Code Monkey home page Code Monkey logo

bashlibrary's Introduction

BashLibrary

A BASH library with useful functions.
There is also a bin directory with useful scripts.
Copyright:
  2013 - 2023 by Cecil Westerhof
Contact:
  [email protected]

There is a LinkedIn group where this library is discussed:
    http://tinyurl.com/BASHScripting

At the moment the functions are not very well documented. Generating some useful functions has a higher priority. Most functions are easy to understand, but when there is a function that would benefit greatly from better documentation: let me know.

If you would like to see a certain function: let me know.

To install the library on your system run install.sh. Use ‘source /usr/local/bash/BASHInitialisation.sh’ (in .bashrc) to initialise the library. To use the scripts add /usr/local/bash/bin to your PATH.

The files contain the following functions:

In BASHInitialisation.sh:

  • addToPath
  • calc
  • canRun
  • chall
  • cdll
  • checkInteger
  • checkNetworkInterface
  • checkReadableDirectory
  • checkReadOnlyVariables
  • cleanPath
  • commandExists
  • convertInput
  • defaultPS_OPTIONS
  • elementInList
  • fatal
  • filterCommand
  • getCPUTemperature
  • getOptionValue
  • getPathDirs
  • isInteger
  • isInteractive
  • isVarSet
  • loadXmodmapExtra
  • logDRY
  • logError
  • logMsg
  • nrOfDirs
  • nrOfFiles
  • nrOfFilesAndDirs
  • psCommand
  • psGrep
  • psPid
  • psPpid
  • psStatus
  • psUser
  • removeFromPath
  • screent
  • showMessage
  • stackTrace
  • stripLeadingZeros
  • taggedMsg
  • taggedMsgAndStackTrace
  • valueInArray
  • variableExist
  • warning In interactive mode also:
  • +=
  • -=
  • ==

In disk.sh:

  • changedToday
  • diskFree
  • diskUsage
  • doUnzip
  • getDirTree
  • getFunctionsFromFile
  • includeFile
  • isReadableFile
  • localFind
  • pushdCheck
  • removeSpacesFromFileNames
  • removeSpecialCharsFromFileName
  • sizeOfFolder

In network.sh:

  • checkInternetConnection
  • checkWiFi
  • connectedToNetwork
  • getIPs

In random.sh:

  • getRandom
  • getRandomInRange
  • getUUID

In system.sh:

  • getMemInfoFromPID
  • getMemInfoFromString
  • getVMPeak

In systemd.sh:

  • checkJournal
  • illegalLogin
  • showJournalctl

In time.sh:

  • getSeconds
  • waitMinutes
  • waitSeconds

The bin directory contains:

  • clojure
  • installGuestAdditions.sh
  • swapUsage.sh: with links to
    • memUsage.sh
    • memUsageProgram.sh
    • programsUsingMem.sh
    • programsUsingSwap.sh
    • swapUsageProgram.sh

bashlibrary's People

Contributors

cecilwesterhof avatar

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.