From fb5ab259dd99839678a57f70b22ec013c852c7e3 Mon Sep 17 00:00:00 2001 From: Ian C Date: Thu, 15 Jun 2017 13:43:12 +0000 Subject: Added mcp and mmv. --- mcp | 18 ++++++++++++++++++ mmv | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 mcp create mode 100755 mmv diff --git a/mcp b/mcp new file mode 100755 index 0000000..9a18825 --- /dev/null +++ b/mcp @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ -z "$3" ] ; then + echo usage: $0 from to file_list + exit 1 +fi + +from="$1" +to="$2" + +shift +shift + +for i in $* ; do + new=$(echo $i | sed "s/$from/$to/g") + echo cp $i $new + cp $i $new +done diff --git a/mmv b/mmv new file mode 100755 index 0000000..746136b --- /dev/null +++ b/mmv @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ -z "$3" ] ; then + echo usage: $0 from to file_list + exit 1 +fi + +from="$1" +to="$2" + +shift +shift + +for i in $* ; do + new=$(echo $i | sed "s/$from/$to/g") + echo mv $i $new + mv $i $new +done -- cgit v1.2.3