parting salutation, 1860, of unknown origin, perhaps from a German idiom (cf. German parting salutation adieu so lange, the full sense of which probably is something like "farewell, whilst (we're apart)"); or perhaps from Hebrew shalom (via Yiddish sholom). Some have noted a similarity to Scandinavian leave-taking phrases, cf. Norwegian Adjø så lenge, Farvel så lenge, Mor'n så lenge, literally "bye so long, farewell so long, morning so long;" and Swedish Hej så länge "good-bye for now," with så länge "for now" attested since 1850 according to Swedish sources. Most etymology sources seem to lean toward the German origin.
Earlier guesses that it was a sailors' corruption of a South Pacific form of Arabic salaam are not now regarded as convincing. "Dictionary of American Slang" also adds to the list of candidates Irish slán "safe," said to be used as a salutation in parting. The phrase seems to have turned up simultaneously in America, Britain, and perhaps Canada, originally among lower classes. First attested use is in title and text of the last poem in Whitman's "Leaves of Grass" in the 1860 edition.
Whitman's friend and fan William Sloane Kennedy, wrote in 1923: