Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 17a9be50e1
Fetching contributors…

Cannot retrieve contributors at this time

executable file 21 lines (17 sloc) 0.408 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/bin/bash
# Bash Script to download a given mp3

# First argument is required
if [ ! -n "$1" ]; then
  echo "usage: `basename $0` url [name]"
  exit $E_BADARGS
fi

# URL for the mp3
url="$1"

# Name of the file is provided or epoch of now.
name=$2
if [ ! -n "$2" ]; then
name=`ruby -e 'puts Time.now.to_i'`
# name=`perl -e 'printf"%d\n", time();'`
fi

# Download
curl "$url" -o "$HOME/Desktop/$name.mp3"
Something went wrong with that request. Please try again.