From the Youth's Companion of April 7, 1864, here are two stories with different versions of an anti-swearing message.
A Brave Tennessee Union Boy
The following story is told concerning some prisoners held by the rebels. There were ninety-six, mostly East Tennesseans, imprisoned for Unionism. The following incident will best describe the quality of their Unionism:
"Among a batch that had lately arrived, was a man whom the rebels were endeavoring to force to take the oath of allegiance to the Southern Confederacy. But his wife, who had been confined just after his arrest, fearing that his regard for her condition might induce him to submit to what was demanded, sent her son, who was only eight years old, to tell his father not to take the oath."
"This brave little fellow came nearly one hundred miles on his mission, and when he arrived, the guards refused to admit him. Undaunted, however, by the rebuff, the young hero got close to the picket fence, and shouted with all his might: "Pa! pa! don't you swear. O, pa, don't you swear! We can get along; I got the lot plowed to put in wheat."
From the same issue:
A YOUNG HERO
Many of the officers stationed at Point Lookout, Md., have their families with them to spend the winter, and among the children are a number of little boys who have imbibed much of the military spirit, and they have organized a company, and drill from time to time. On one occasion one of these young officers used profane language, and no sooner had he uttered that oath than he threw his sword upon the ground, saying "If I can't be an officer without swearing I will not be an officer any longer" - Congregationalist