Skip to content

Instantly share code, notes, and snippets.

@dbadapt
Last active August 29, 2015 14:22
Show Gist options
  • Save dbadapt/da21716b280834b48f31 to your computer and use it in GitHub Desktop.
Save dbadapt/da21716b280834b48f31 to your computer and use it in GitHub Desktop.
Get a single file from a launchpad repository
#!/bin/bash
# download a single file from launchpad
SRC_FILE=pxc56-mtr.sh
REL_URL=$(
wget -q -O - "http://bazaar.launchpad.net/~percona-core/percona-qa/trunk/view/head:/${SRC_FILE}" \
| grep 'download file' \
| head -n1 \
| cut -d'"' -f2
)
ABS_URL="http://bazaar.launchpad.net${REL_URL}"
wget -q -O - "$ABS_URL" > ${SRC_FILE}
chmod 755 ${SRC_FILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment