Git Coding HELP for scripting projecy We have provided you w
Git Coding HELP for scripting projecy!!
We have provided you with a string array. Use this for file matching and creating directories:
# usage example: ./script3 target_directory
MONTHS=(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
// code goes here
Your objective is to write a shell script that allows yourself to pass an argument that represents the directory where the slides are, and copy all the slides into your current directory where your script is. While doing so, categorize each slide into a directory of corresponding month. Namely, after your script is run, you should be able to find a slide named Lecture1028thOct2015.pdf under a directory named Oct/ , and so on. Notice that if a directory of a month does not exist, you should create it with mkdir . Otherwise, you should not attempt to make this directory again. Your script should not have any error output as long as it’s run correctly.
Example:
[cs15x ieng 6-2011 cript 3:581$ ls before script is run Makefile script3.s cs15xeieng 6-2011 my script 3:582$ ./script 3.sh SPUBLIC/slides run the script cs15x0ieng 6-201 j:myScript 3:583$ ls -R after the script is run Apr Dec Feb Jan Jun Makefile Mar May Nov 0ct Sep script3.sh /Apr SE15L Spring2016Lecture1027thApril2016.pdf CSE15LSpring2016Lecture511thApril2016.pdf CSE15LSpring2016Lecture820thApril2016.pdf CSE15LSpring2016Lecture925thApril2016. pdf CSE15LSpring2016Lecture34thApril 2016.pdf CSE15LSpring2016Lecture613thApril2016.pdf E15LSpring2016Lecture46thApril2016.pdf CSE15LSpring 2016Lecture718thApril2016.pdf /Dec CSE15LFall2015Lecture192nd Dec2015.pdf /Feb CSE15LWinter2016Lecture108thFeb2016.pdf CSE15LNinter2016Lecture1324thFeb2016.pdf CSE15LNinter2016Lecture93rd 016.pdf CSE15LWinter2016Lecture11 10th Feb2016.pdf CSE15LNinter2016Lecture1429thFeb2016.pdf CSE15Lwinter2016Lecture1222ndFeb2016.pdf CSE15LNinter2016Lecture81stFeb2016. pdf /Jan CSE15L winter 2016Lecture 14th Jan2016. pdf CSE15LWinter2016Lecture413thJan2016.pdf CSE15LNinter2016Lecture727thJan2016.pdf E15LWinter 2016Lecture26th Jan2016. pdf CSE15LWinter2016Lecture520thJan2016.p CSE15LWinter2016Lecture311thJan2016.pdf CSE15LWinter2016Lecture625thJan2016.pdf /Jun SE15LSpring2016Lecture181st June 2016.pdf /Mar CSE15LSpring2016Lecture128thMarch2016.pdf CSE15LWinter2016Lecture152ndMar2016.pdf CSE15LSpring2016Lecture230thMarch2016.pdf CSE 15LWinter2016Lecture167thMar2016. pdf /May CSE15LSpring2016Lecture112ndMay2016.pdf CSE15LSpring2016Lecture1416thMay2016.pdf CSE15LSpring2016Lecture1725thMay2016.pdf CSE15LSpring 2016Lecture124thMay2016.pdf CSE15LSpring2016Lecture1518thMay2016.pdf CSE15LSpring2016Lecture139thMay2016.pdf CSE15LSpring2016Lecture1623rdMay2016.pdf /Nov CSE15LFal12015Lecture1725thNov2015.pdf CSE15LFall2015Lecture112ndNov2015.pdf CSE15LFall2015Lecture1416thNov2015.pdf CSE15LFall2015Lecture124thNov2015.pdf CSE15LFall2015Lecture1518thNov2015.pdf CSE15LFall2015Lecture1830thNov2015.pdf CSE15LFall2015Lecture139thNov2015.pdf CSE15LFall2015Lecture1623rdNov2015.pdf /Oct E15LFall2015Lecture1028thoct2015.pdf CSE15LFall2015Lecture512thoct2015.pdf stoct2015.pdf E15LFall2015Lecture35thoct2015.pdf CSE15LFal12015Lecture614thoct2015.pdf E15LFall2015Lecture926thoct2015. pdf CSE15LFall2015Lecture 47thoct2015.pdf CSE15LFall2015Lecture719thoct2015.pdf /Sep CSE15LFall2015Lecture128thSep2015.pdf CSE15LFall 2015Lecture230thSep2015.pdf 15x01 en 6 20 Script 3:584$ ISolution
A)
the script will save this files within the current date with $(date +%Y%m%d) format, like 1028thOct2015.tar.gz, then when the next month arrives.
present_month = $(date -d \" month\" +%Y%m%d)
day = $(date +%d)
if [ \"$day\" != 01 ] && [ \"$day\" != 15 ]
then
rm /path/of/files/${present_month}.tar.gz
echo \"Depuration done\"
else
echo \"Keep file\"
fi

