Skip to content

Instantly share code, notes, and snippets.

View ericlong's full-sized avatar

Eric Long ericlong

  • CloudBees
  • Austin, TX
View GitHub Profile
@slank
slank / Notes
Created June 4, 2015 04:41
Bash Power Tips Walkthrough
# Variables
FOO=here
FOO="here" # equivalent, always use quotes
BAR=$FOO
BAR="$FOO"
BAR="${FOO}"
BAR='$FOO' # single quotes, does not evaluate the variable
@abayer
abayer / jenkins-git-backup.sh
Last active January 8, 2023 09:19
Example of a script for backing up Jenkins config in git.
#!/bin/bash
#
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
#
set -ex
if [ $# -ne 2 ]; then
echo usage: $0 root_dir jenkins_master