zsh-users
 help / color / mirror / code / Atom feed
* translate all sequences of whitespace/underscores to single dashes
@ 2015-08-17  0:20 Emanuel Berg
  2015-08-17  1:57 ` Kurtis Rader
  0 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2015-08-17  0:20 UTC (permalink / raw)
  To: zsh-users

How can I do this directly and only in zsh, i.e.
not using tr (translate characters)?

    # whitespace(s) and underscore(s) -> (a single) dash
    new_name=${new_name//[_ ]/-}
    new_name=`echo $new_name | tr -s "-"`

Here is the file for context:

    http://user.it.uu.se/~embe8573/conf/.zsh/files-fs

Feel free to help me with other issues in that file
as well.

-- 
underground experts united
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-17 14:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-17  0:20 translate all sequences of whitespace/underscores to single dashes Emanuel Berg
2015-08-17  1:57 ` Kurtis Rader
2015-08-17  8:47   ` Peter Stephenson
2015-08-17 11:27     ` Jun T.
     [not found]     ` <9D99B267-5DDD-4C5B-A33A-C5A0251A4B9F__19706.0165032328$1439813299$gmane$org@kba.biglobe.ne.jp>
2015-08-17 12:19       ` Stephane Chazelas
2015-08-17 14:51         ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).