And with midshipmen and boys, young fellows in training to be officers or sailors, standing for long periods toeing the line was a punishment for minor misdeeds. Today, of course, the phrase means that one should obey social rules. In their heyday, a thousand years ago, it was customary among Viking raiders to go into battle bare chested. The terror these marauders struck in many parts of the known world is legendary. When we use it now, we mean that someone should mind his or her own business, or pay attention to the task at hand.
Phrases pairing opposites or actions are popular both on shore and at sea.
Often, it is used when a ship at anchor finds herself subjected to a bad storm which threatens to force her onto a lee shore. In that situation, the master will not trouble himself to weigh anchor, but will cut his anchor cable and seek to move to safer waters offshore, whether by sail or engine power. This state of permanence came ashore, modified to mean something that is inflexible, such as a hard and fast rule. Years ago, when a ship was in unknown waters and near land, a prudent master would, at sunset, sail back and forth, toward and away from the landfall, roughly maintaining his position until daylight would again permit him to see where he was going as he sailed into ever-shallower waters. The crew enjoyed it because they rarely had to go above and manhandle the sails.