Need help on bash scripting in Linux

Could anyone help me with the below scripting task.

my requirement is as below

  1. I have two directories /var/tmp/dir1 & /var/tmp/dir2
    once i run the script test.sh it should ask as below.

Please choose the below path 1 (or) 2

  1. /var/tmp/dir1

  2. /var/tmp/dir2
    else. exit

  3. once i enter 1, it should go to the path /var/tmp/dir1/08042015/

here is a directory 08042015 (ddmmyyyy) with current date

  1. in 08042015 dir - redirect the output of the command "ls -lrt" to a file if output count (ls -lrt |wc -l > 10). (if output found redirect or wait for ls -lrt the output)

Hi and welcome to the forums.

What have you tried so far?
Please use the code tags (next to php) to show code or terminal output.
Where are you stuck?

Have a nice day.

Sorry Sir. I do not know how to write the scripting.

Try this (untested):

strDate=$(date +'%d%m%Y')
outputFile=~/myLog.txt

select curDir in  /var/tmp/dir1   /var/tmp/dir2
do	cd "$curDir/$strDate"
	echo "$PWD" >> "$outputFile"
	data=$(ls -lrt)
	num=$(echo "$data" | wc -l)
	[ $num -gt 10 ] && \
		echo >> "$outputFile"
done

gtg & hth

Is this homework?