#!/bin/sh usage() { echo "youtuber -c [channel name] -u [channel url]" echo "you may only specify channel name or url, and must specify one" } if [ $#@ != 2 ] then usage() exit 127 fi while getopts "u:c:" opt; do case "$opt" in u) URL=$2 shift ;; c) URL=https://www.youtube.com/$2 shift ;; *) usage() exit 127 ;; esac done shift $((OPTIND-1)) RSS=`curl -s $URL |tr ':' '\n'|grep -A 2 rssUrl|tail -1 |cut -d'"' -f1|cut -d'/' -f3,4,5` echo $RSS