rendered paste body#!/bin/bash
dialog --title "Epilogi 1ou fakelou" --clear \
--inputbox "Grapse to proto path:" 0 0 2> ./tempfile
retval=$?
case $retval in
0)
dir1=`cat ./tempfile`;;
1)
echo "Error1";;
255)
echo "Error2";;
esac
dialog --title "Epilogi 2ou fakelou" --clear \
--inputbox "Grapse to deftero path:" 0 0 2> ./tempfile2
retval=$?
case $retval in
0)
dir2=`cat ./tempfile2`;;
1)
echo "Error2-1";;
255)
echo "Error2-2";;
esac
# --------------------------------------------------
dialog --clear --title "Epiloges:" \
--menu "edo epilegeis ti na kaneis" 20 51 4 \
"Epilogi" "Epelekse 2 arheia" \
"Sygkrisi" "Sygkrine ta epilegmena arheia sou" \
"Sort" "Kane sort opos ta thelei o mapas" \
"Synchronise" "Synhronise ta arheia" 2> ./tempchoice
retval=$?
choice=`cat ./temchoice`
case $retval in
0)
echo "Exeis epileksei: '$choice'";;
1)
echo "Cancel!!";;
255)
echo "ESC.. hmmm";;
esac
# -----------------------------------------------------
#echo -n "First path: "
#read dir1
#echo -n "Second path: "
#read dir2
ls -l $dir1 | grep ^- | awk '{print $9}' > first.tmp
ls -l $dir2 | grep ^- | awk '{print $9}' > second.tmp
echo "---------------FIRST PATH TEST---------------------"
tragiko1=( `cat first.tmp`)
for i in "${tragiko1[@]}"
do
echo "$i"
done
echo ""
echo "---------------SECOND PATH TEST---------------------"
tragiko2=( `cat second.tmp`)
for k in "${tragiko2[@]}"
do
echo "$k"
done