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

Substituting newline on a string



I have a seemingly trivial problem that I have not be able to solve. How do I replace a newline in a string with somethinge else, like ' ' (or better yet '\n')?

I've tried 

cmd=${1/$/ /}
cmd=${1/\n/ /}
cmd=${1/\r/ /}

plus any thing else I could think of without success.

In case it matters, I'm trying to put the command being executed into my xterm title bar from preexec() and I want to be able to handle multi-line commands.

Thanks for any help.



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