Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Can I put a newline in an alias?



On Jul 19,  9:51pm, Russell Hoover wrote:
} Subject: Can I put a newline in an alias?
}
} This is a pretty basic question, but i tried using \n and ^M to put a
} newline, or carraige return, into an alias, and neither worked.
} 
} How is this done? Or is it? Also how can i put a 'control-whatever'
} sequence into an alias?

zsh% alias this_has_a_newline='echo this
quote> echo has a newline'
zsh% this_has_a_newline
this
has a newline

Same thing should work for any control sequence; just put it in quotes.

Notice that in the sample above the newline was taken as a command
separator.  That's probably not what you mean, but since you didn't
say why you want to include a newline or control ...

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author