“Rascals, would you live forever?”
To hesitant guards at the battle of Kolin https://en.wikipedia.org/wiki/Battle_of_Kol%C3%ADn#Battle, 18 June 1757
Attributed in E. M. Knowles, Oxford Dictionary Of Quotations (5th Edition) (Oxford University Press, 1999)
"Kerels, wollt ihr den euwig leben?" Frederick the Great, by David Fraser, Penguin 2000, p. 353 Other versions have it: "Hünde, wollt ihr euwig leben?" (Dogs, do you want to live for ever?).
Attributed
Help us to complete the source, original and additional information
Frederick II of Prussia 36
king of Prussia 1712–1786Related quotes

Book Five : "Mundus Vult Decepi", Ch. XXIX : The Grumbler's Progress
The Silver Stallion (1926)

“Live as if you were to die tomorrow. Learn as if you were to live forever.”
Variant on aphorism "Study as if you were to live forever. Live as if you were to die tomorrow" pre-dating Gandhi, variously attributed to Isidore of Seville (c. 560 – 636), in FPA Book of Quotations (1952) by Franklin Pierce Adams, to Edmund Rich (1175–1240) in American Journal of Education (1877), or to Alain de Lille in Samuel Smiles's Duty https://books.google.com/books?id=33UzAAAAMAAJ&pg=PA363&dq=live+die+tomorrow+learn+forever&hl=en&sa=X&ved=0ahUKEwjd3s_2m57MAhWFMGMKHe-sAl8Q6AEIHDAA#v=onepage&q=live%20die%20tomorrow%20learn%20forever&f=false (1881).
The 1995 book "The good boatman: a portrait of Gandhi," states that Gandhi subscribed "to the view that a man should live thinking he might die tomorrow but learn as if he would live forever."
In his 2010 Boyer lecture Glyn Davis (Professor of Political Science and Vice-Chancellor of Melbourne University) attributes the quote to Desiderius Erasmus. "He [Erasmus] reworked Pliny to urge 'live as if you are to die tomorrow, study as if you were to live forever'. Many students obey the first clause - the best heed both."
There is a similar quote by Johann Gottfried Herder: "Mensch, genieße dein Leben, als müssest morgen du weggehn; Schone dein Leben, als ob ewig du weiletest hier." ["Man, enjoy your life as if you were to depart tomorrow; spare your life as if you were to linger here forever."] (Zerstreute Blätter, 1785).
Disputed

“Learn as if you were to live forever; live as if you were to die tomorrow.”
They Call Me Coach (1972)

Mark Twain in eruption: hitherto unpublished pages about men and events, 1940, Mark Twain, Bernard Augustine De Voto, Harper & brothers. This appears to be the origin of the variant:
If you would have your work last forever, and by forever I mean fifty years, it must neither overtly preach nor overtly teach, but it must covertly preach and covertly teach.
Attributed to Twain by J. Michael Straczynski in The complete book of scriptwriting, 2002, Writer's Digest Books

“His life was two lives now: the life he would have and the life he would forever wonder about.”
Source: Beautiful Ruins

“Study as if you were going to live forever; live as if you were going to die tomorrow.”
The Book of Positive Quotations By John Cook, Leslie Ann Gibson (2nd ed. 2007), p. 283.
Attributed

“To love abundantly is to live abundantly, and to love forever is to live forever.”