Skip to content

Instantly share code, notes, and snippets.

@MatthewHannigan
MatthewHannigan / gist:fca0ca0f80b91234f17a
Last active August 29, 2015 14:07
bash expands {c,h} before the command sees it
$ echo fish >a.c
$ grep -r --include=\*.{c,h} fish .
./a.c:fish
$ grep -r --include=\*.{c,h} fish .
./a.c:fish
grep doesn't like {c,h}
$ grep -r --include="*.{c,h}" fish .
$ grep -r --include="*.[ch]" fish .
@MatthewHannigan
MatthewHannigan / gist:5210474
Created March 21, 2013 03:28
atlassian gdb dump core script with modifications to use mktemp and trap to clean up untested :-)
#!/bin/bash
# atlassian-heap-dump.sh - dump a heap using GDB for a crashed application
# Accepts a single argument: the PID of the JVM
# Author: James Gray (jgray@atlassian.com)
# Copyright Atlassian P/L
# License: MIT
# Are we root?
if [ $UID -ne 0 ]; then