#!/bin/bash
#set -x
declare -a v_p
v_p=(error)
declare -a v_array
v_array=(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 + /)
#set +x
sub_input(){
v_end01=1;
while [ $v_end01 == 1 ]
do
case $1 in
A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|+|/)
export x=1
;;
*)
echo "Please input, like A A A A A B"
echo "The rule is like A(64^1) and B(64^0)...... in above example."
echo "There are six position"
exit ###supplementary
;;
esac
for i in $(seq 0 63) ;
do [ "$1" == "${v_array[$i]}" ] && v_p[0]=$i && v_end01=0
done;
done;
v_end02=1;
while [ $v_end02 == 1 ]
do
case $2 in
A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|+|/)
export x=1
;;
*)
echo "Please input, like A A A A A B"
echo "The rule is like A(64^1) and B(64^0)...... in above example."
echo "There are six position"
exit ###supplementary
;;
esac
for j in $(seq 0 63) ;
do [ "$2" == "${v_array[$j]}" ] && v_p[1]=$j && v_end02=0
done;
done;
v_end03=1;
while [ $v_end03 == 1 ]
do
case $3 in
A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|+|/)
export x=1
;;
*) exit ###supplementary
;;
esac
for k in $(seq 0 63) ;
do [ "$3" == "${v_array[$k]}" ] && v_p[2]=$k && v_end03=0
done;
done;
v_end04=1;
while [ $v_end04 == 1 ]
do
case $4 in
A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|+|/)
export x=1
;;
*) ###supplementary
echo "Please input, like A A A A A B"
echo "The rule is like A(64^1) and B(64^0)...... in above example."
echo "There are six position"
exit ###supplementary
;;
esac
for l in $(seq 0 63) ;
do [ "$4" == "${v_array[$l]}" ] && v_p[3]=$l && v_end04=0
done;
done;
v_end05=1;
while [ $v_end05 == 1 ]
do
case $5 in
A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|+|/)
export x=1
;;
*) ###supplementary
echo "Please input, like A A A A A B"
echo "The rule is like A(64^1) and B(64^0)...... in above example."
echo "There are six position"
exit ###supplementary
;;
esac
for m in $(seq 0 63) ;
do [ "$5" == "${v_array[$m]}" ] && v_p[4]=$m && v_end05=0
done;
done;
v_end06=1;
while [ $v_end06 == 1 ]
do
case $6 in
A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|+|/)
export x=1
;;
*) ###supplementary
echo "Please input, like A A A A A B"
echo "The rule is like A(64^1) and B(64^0)...... in above example."
echo "There are six position"
exit ###supplementary
;;
esac
for n in $(seq 0 63) ;
do [ "$6" == "${v_array[$n]}" ] && v_p[5]=$n && v_end06=0
done;
done;
}
sub_input $1 $2 $3 $4 $5 $6
#set -x
#echo ${v_p[0]}
#echo ${v_p[1]}
#echo ${v_p[2]}
#echo ${v_p[3]}
#echo ${v_p[4]}
#echo ${v_p[5]}
echo "The rowid value is:"
echo "${v_p[0]}*(64^5)+${v_p[1]}*(64^4)+${v_p[2]}*(64^3)+${v_p[3]}*(64^2)+${v_p[4]}*(64^1)+${v_p[5]}*(64^0)" | bc
Convert Rowid
原创emperor_majesty 博主文章分类:Shell ©著作权
©著作权归作者所有:来自51CTO博客作者emperor_majesty的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
物理rowid
物理rowid有下面2个格式中的一个:
rowid 数据块 表空间 oracle 函数返回