Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • bash does not add alias when in POSIX mode (invoked as sh or POSIXLY_CORRECT in the environment or --posix, -o posix...) Commented Feb 7, 2015 at 20:47
  • @StéphaneChazelas - yeah, that's why I used sh at the bottom - it will work even when sh is bash. Commented Feb 7, 2015 at 20:49
  • See also: a=$'\n' ksh -c 'alias foo="$a"; alias foo', or single quotes, the OP wanted the text escaped for a SQL interpreter, not a shell. Commented Feb 7, 2015 at 20:51
  • @StéphaneChazelas - I thought it was for pasting into a command-line SQL query? But, yes, ksh derivatives do the ANSI quote strings. Commented Feb 7, 2015 at 20:52