Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tonebeta/4bdee358a288edf06e7a232d4cf3d480 to your computer and use it in GitHub Desktop.
Save tonebeta/4bdee358a288edf06e7a232d4cf3d480 to your computer and use it in GitHub Desktop.
#!/bin/bash
WORKSPACE="/home/csie/shell/"
while [ 1 ]
do
read -p "Enter a element: " element
read -p "Enter quantity: " quantity
mkdir $element
cd $element
i=1
while [ $i -le $quantity ]
do
echo ${element}"_"${i}
mkdir ./${element}"_"${i}
cd ./${element}"_"${i}
${WORKSPACE}log.sh $element $i > result.txt >> ${WORKSPACE}log.txt
cd ..
i=$(($i+1))
done
cd ..
read -p "Continue [Y/N]?" isContinue
[ $isContinue == N ] && cat log.txt && exit
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment