This movie was probably in the 20th century or the edge between 20th and 21st.
It was related to some kind of army camp or service where they still had old uniform with these interesting hats. One of the or the main character was also wearing glasses and I remember him being kinda weak and all shy when there was that scene where the army was standing in a line and the commander or officer was checking on them and shouted at the dude.
I really need help with finding that one.
Stripes [1981]
https://www.imdb.com/title/tt0083131/
There was a lot of shouting in Full Metal Jacket. Some of the soldiers wore helmets with designs and buttons added to them.
https://www.imdb.com/title/tt0093058/?ref_=fn_al_tt_1
Possibly Biloxi Blues (1988)? Christopher Walken does a great job of playing a drill sergeant, who likes to yell and give out pushups. One of the enlisted men, played by Corey Parker, is kinda skinny, wears glasses and gets in a trouble a bit by the sergeant.
https://www.imdb.com/title/tt0094746/