I know that Pearl Harbor directly spurred major racism against people of Japanese origin, leading to the camps, but was there this general fear of an imminent attack similar to the fear of terrorist attacks today?
This is a comparison that has been done countless times. There are hundreds of articles offering different points of view on similarities and differences. The short answer is: yes. Japanese Americans were rounded up and forced into internment camps. Anti-Japanese propaganda about invasion in the style of the time was prevalent.
Of course the specifics differ. Japan was a sovereign nation, al-Qaeda was a non-state actor. At Pearl Harbour the casualties were mostly military, whereas the Twin Towers deaths were almost entirely civilian.
I'd suggest some further reading. There's plenty out there - and it's the sort of well-covered issue that you could really form you own view on.