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

translate all sequences of whitespace/underscores to single dashes



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



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