adding new file
This commit is contained in:
16
conv1to2
Executable file
16
conv1to2
Executable file
@@ -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
|
||||||
39
numberDL
Executable file
39
numberDL
Executable file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user