Need one line scripting on Unix shell..help!!

Hi Experts,

I need one line script for the below requirement.

First it should check if a directory with todays date exist, and if not create it and move the PDF file to that directory.

thanks in advance!!!

it will check whehter the directory (YYYYMMDD) is exists or not. if exists move all the pdf files. if not create a directory and move all the pdf files into that directory

 
dirname=`date +%Y%m%d`; [ -d $dirname ] && mv *.pdf $dirname/ || ( mkdir $dirname && mv *.pdf $dirname/ )
1 Like

Thanks for your reply.

It works perfectly...!!