diff --git a/conv1to2 b/conv1to2 new file mode 100755 index 0000000..6ca9fb5 --- /dev/null +++ b/conv1to2 @@ -0,0 +1,16 @@ +#!/bin/bash + +IFS=$'\n' +if [ -z "$1" ] +then echo give two strings + exit +fi + +for file in $( ls | grep "$1" ) +do mv -iv "$file" "$( echo $file | sed s/"$1"/"$2"/g )" +done +echo 'sure?' +read i +for file in $( ls | grep "$1" ) +do echo mv -iv "$file" "$( echo $file | sed s/"$1"/"$2"/g )" +done diff --git a/numberDL b/numberDL new file mode 100755 index 0000000..6d251bf --- /dev/null +++ b/numberDL @@ -0,0 +1,39 @@ +#!/bin/bash +if [ -z "$1" ] +then +echo "use: $0 http://etc/ 01 .jpg 30 wget" +echo "length of first number as a string defines padding" +exit +fi + +jotai="$1" +paate="$3" +# From +i=$( echo $2 | sed 's,^0\+,,' ) +if [ "$i" = "" ] +then i=0 +fi +# To +t=$4 +# xargs to +comm=$5 +pad=${#2} +if [ -z "$comm" ] +then comm="echo" +fi +while [ "$i" -le "$t" ] +do + j=$( printf "%0${pad}d" $i ) + if [ "$comm" = "wget" ] + then + echo oo + # wget -S --spider | grep __error codes.. (or OK) + wget -U 'Mozilla/4.0 (compatible: MSIE 5.5: Windows NT 5.0)' --referer="${jotai}${j}${paate}" "${jotai}${j}${paate}" + else + echo ${jotai}${j}${paate} | xargs $comm + fi + + let "i = 1 + $i" +done + +