Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Substituting newline on a string
- X-seq: zsh-users 12991
- From: Javier Alvarado <quijotista@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Substituting newline on a string
- Date: Tue, 1 Jul 2008 10:34:45 -0700 (PDT)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Message-ID; b=vGy90IObvL4IP2COUVb9yeUOxN+HTNYHuGKLoPD22MIP7q+uj/sJ0ye9pNxJ5hU8ylP/TvNTKQN+um1O/4qqbF6m7HjAUfYMxzArHJDi5IWZJkbD6OnScVp1sGRQpZW5DjuegTd2eOEgFMWm5kYLqNCbf7oJpzKjmbEoLDbe188=;
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Reply-to: quijotista@xxxxxxxxx
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