When Napoleon gathered his victorious troops under the Pyramids, he had some inspiring words about the centuries of history staring down at them. The history is still staring down, but the man who visited the site last night was more like a footnote to history than an actor in it.

Frank Sinatra sang at the Pyramids last night, his first appearance in Egypt during a 40 year career. But this concert had little but the backdrop to distinguish it from what he has been doing for years at Las Vegas and around the world.

It is a sign, however, of changing times. In Egypt, Sinatra has been known for his support of Israel. Now here he was singing in a benefit performance to a mix of wealthy Egyptians and foreigners with the three great Giza Pyramids rising behind him and the Sphinx standing guard. Moreover, Sinatra was fresh from a personal conversation with President Anwar Sadat, who although he is not attending the performance, authorized Egyptian state television to film it.

Sinatra sang selections for 45 minutes from 17 of his old favorites, such as "Bewitched," "I've Got You Under My Skin," "My Way" and "Strangers in the Night."

Sinatra also underlined his respect for Sadat, whose peace efforts he called the "eighth wonder of the world."

During a break he also quipped about his support of Israel, calling himself "Francis Albert Eisenberg" to chuckles from the Egyptian and foreign audience. Referring to the Pyramids behind him, he expressed wonder at "these edifices" and added: "If the Italians had done it, they would never have finished it."

Except for a narrow stratum of leftist intellectuals and students, most Egyptians seem to agree that welcoming such a friend of Israel, and Israelis themselves, is a good idea.

Popular appeal had little to do with Sinatra's performance here, however. The approximately 800 in the audience paid more for tickets than most Egyptians ever see at one time. The minimum for an Egyptian couple was $150. Some foreigners paid far more, a minimum of $2,500 for their stay in Cairo revolving around Sinatra's performance. Choice tables at the concert went for $30,000.

Those on the guest list included Prince and Princess Borghese, Count Michel de Ganay and his countess; Count Jean de Rohan-Chabot and his countess; Princess Ghislaine de Polignac, and the duke and duchess of Bedford.

The night before the concert, they added their tone and titles to a fashion showing beside the pool of the Mena House hotel, an elegant establishment next to the Pyramids where the first Egyptian-Israeli peace conference took place in December 1977. Pierre Balmain paraded his imported models, mostly blond, with 50 of his dresses and heavy diamond jewelry from Bulgari. Egypt's own Fifi Abdou belly danced around a poolside platform and then did an encore enrty, gyrating precariously on a horse's back.