Conversion batch shell script

while converting batch file to shell script ...dis command is ther i dunno how to change...can anyone knws how to change into shell script

rm !(D:\temp\XX.txt)

This does not make sense: the \ character and D: are all windows related. rm is a UNIX command. So this is a mixture and would not have run anywhere.

while running the batch file...it erroring like share directory does not exist...it means any previlege?

What exactly are you running, on what kind of machine? Your question as-is doesn't make much sense.