Giter VIP home page Giter VIP logo

bashcookbook-examples's Introduction

bash Cookbook examples

Welcome to the examples from the bash Cookbook (second edition), by Carl Albing and JP Vossen.

About the Book

For system administrators, programmers, and end users, there are occasions when a simple (or not so simple) shell script can save you time and effort, or facilitate consistency and repeatability for a variety of common tasks. This cookbook provides more than 300 practical recipes for using bash, the popular Unix shell that enables you to harness and customize the power of any Unix or Linux system.

Ideal for new and experienced users alike--including proficient Windows users and sysadmins--this updated second edition helps you solve a wide range of problems. You'll learn ways to handle input/output, file manipulation, program execution, administrative asks, and many other challenges. Each recipe includes one or more scripting examples and a discussion of why the solution works.

You'll find recipes for problems including:

  • Standard output and input, executing commands
  • Shell variables, shell logic, and arithmetic
  • Intermediate shell tools and advanced scripting
  • Searching for files with find, locate, and slocate
  • Working with dates and times
  • Creating shell script for various end-user tasks
  • Working with tasks that require parsing
  • Writing secure shell scripts
  • Configuring and customizing bash

Example Files

Each sub-directory contains the important, long, or difficult-to-type examples from the relevant chapter.

./settings, however, is special. It contains a collection of sample configuration files, see ./settings/README and chapter 16 for details.

bashcookbook-examples's People

Contributors

vossenjp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bashcookbook-examples's Issues

script func_tweak_path ch16 error

See the line:

# Make sure it's not already in the $PATH
if [ $(contains "$PATH" "$directory") ]; then
echo "$0:$FUNCNAME: '$directory' already in \$PATH--aborting" >&2

This warning message from the echo command:

echo "$0:$FUNCNAME: '$directory' already in \$PATH--aborting" >&2

It is never shown because when in the contains function the value is equal to an existing value the return code is "1" and the if statement above is dealing only with output code "0"

For shows I had to put the "!" of denial in the script, being:

 # Make sure it's not already in the $PATH
    if ! [ $(contains "$PATH" "$directory") ]; then

Sorry English, I'm Brazilian and I did what I could, thank you!

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.