2013-05-25 11:09:14 -04:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2013-06-06 14:44:39 -04:00
|
|
|
# Copies a html file without its sorting prefix
|
2013-05-25 11:09:14 -04:00
|
|
|
#
|
|
|
|
# Copyright (C) 2013 Mike Gerwitz
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
##
|
|
|
|
|
|
|
|
sstrip()
|
|
|
|
{
|
|
|
|
base="$( basename "$1" )"
|
2013-06-06 14:44:39 -04:00
|
|
|
echo "${1%/*}/${base#??-}"
|
2013-05-25 11:09:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
[ -n "$2" ] || {
|
|
|
|
echo "Usage: $0 src dest" >&2
|
|
|
|
exit 64
|
|
|
|
}
|
|
|
|
|
2013-06-06 14:44:39 -04:00
|
|
|
# ensure that parent directory exists
|
2013-06-16 13:23:39 -04:00
|
|
|
dir="${2%/*}"
|
|
|
|
[ -z "$dir" ] || mkdir -p "$dir"
|
2013-05-25 11:09:14 -04:00
|
|
|
|
2013-06-06 14:44:39 -04:00
|
|
|
dest="$( sstrip "$2" )"
|
|
|
|
cp -v "$1" "$dest"
|