#!/bin/sh tmpfile=$(mktemp); echo "(defun f(s)(sort (split-string s \"\" t)'(lambda (a b)(string-collate-lessp a b \"POSIX\" t))))(print (f \"String\"))" > $tmpfile; emacs --script $tmpfile; rm $tmpfile;