Giter Club home page Giter Club logo

bash-commands's Introduction

bash-commands

read from json

property=$(echo $(grep -A 1 -m1 "property" config.json | cut -f2 -d":" | tail -1 | sed 's/[,"]//g'))

with jq:

property=$(cat config.json | jq '.parameters | from_entries | .property')

Overview

Perl Regexp

e.g.

grep -Po "(?<=UBUNTU_CODENAME=).*" /etc/os-release

for loops

bash functions

parameter expansion

tar GitLab artifact archive

# Downloads folder via wget using requests Certificate Authority BUNDLE and Gitlab Personal Access Token (PRIVATE_TOKEN) to retrieve the <dir>/<subdir1>/<subdir2> folder and strip it 3 levels deep so that only the contents of subdir2 remain in the current directory.
wget --ca-certificate $REQUESTS_CA_BUNDLE -L --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" "https://gitlab.com/api/v4/projects/<project id>/repository/archive.<format>?ref=<ref>&path=<subdir1>/<subdir2>" -qO - | tar -xzf - --strip-components=3

tar options:

  • x extract
  • f file
  • z for gunzip files (i.e. for unzipping the .gz)

bash-commands's People

Contributors

gro1m avatar

Watchers

 avatar  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.