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

Re: join a string with a parameter value if it's not empy



> p='value' -> result: 'value_string'
> p='' -> result: 'string'

A simpler variation of your first solution:

$p${p:+_}string


--
Sent with HEY


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