Skip to content

Instantly share code, notes, and snippets.

@BigDru
BigDru / parse-options.sh
Created May 4, 2018 02:27 — forked from cosimo/parse-options.sh
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
@BigDru
BigDru / gist:1e0ae73105d65f612e1e
Last active August 29, 2015 14:11 — forked from battleguard/gist:2161363
RS General Exchange Get Prices
/**
* Find item price on the grand exchange
* @param itemName The name of the item
* @return Price of the item
*/
public int getGuidePrice(final String itemName) {
return Integer.parseInt(lookup(itemName)[1]);
}
/**