Skip to content

Instantly share code, notes, and snippets.

@kamermans
kamermans / install_jq.sh
Created January 22, 2015 17:21
Install jq (JSON Command Line processor)
#!/bin/bash -e
# This scripts installs jq: http://stedolan.github.io/jq/
JQ=/usr/bin/jq
curl https://stedolan.github.io/jq/download/linux64/jq > $JQ && chmod +x $JQ
ls -la $JQ
@thrawn01
thrawn01 / gist:1753234
Created February 6, 2012 16:47
rebinds output of the currently running shell
#! /usr/bin/env bash
echo "before exec"
TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"}
LOGFILE=test.$(date "+$TIMESTAMP_FORMAT")
# Redirect stdout/stderr to tee to write the log file
exec 1> >( tee "${LOGFILE}" ) 2>&1
echo "after exec"