How is nesting achived so i can run a statement such as below (the loop to change files & directories is not shown but that does work to chnge them as required)
This is my test code:
Code: Select all
aa="201901"
bb="201902"
cc="201903"
if [ ${j} == ${aa} ]
then echo "aa moved" ##mv "${m}" "${n}" #########commected out for testing
elif [ ${j} == ${bb} ]
then echo "bb moved" ##mv "${m}" "$[n}" #########commected out for testing
elif [ ${j} == ${cc} ]
then echo "cc moved" ##mv "${m}" "${n}" #########commected out for testing
## elif j == "201904" mv -1 "{l}" "n"
## elif j == "201905" mv -1 "{l}" "n"
## elif j == "201906" mv -1 "{l}" "n"
## elif j == "201907" mv -1 "{l}" "n"
## elif j == "201908" mv -1 "{l}" "n"
## elif j == "201909" mv -1 "{l}" "n"
## elif j == "201910" mv -1 "{l}" "n"
## elif j == "201911" mv -1 "{l}" "n"
## elif j == "201912" mv -1 "{l}" "n"
else: echo "No Files Left To Move"
fi
############# OUTPUTTED errors in above #############
cc moved
./CreatejpgDirs: line 44: else:: command not found