nitter
Ross Burton
@rossburton
15 Aug 2016
Anyone know a neat way to do FOO=$FOO:bar in bash without adding the : if FOO was empty?
2
Daniel Silverstone ๐๐๐๐ยฒ ๐ณ๏ธโ๐๐ฌ๐ง
@dsilverstone
15 Aug 2016
Replying to
@rossburton
FOO=${FOO}${FOO:+:}bar
Aug 15, 2016 ยท 12:11 PM UTC
1
1
Ross Burton
@rossburton
15 Aug 2016
Replying to
@dsilverstone
yeah that's likely the neatest solution. Damned LD_LIBRARY_PATH behaviour with lonely colons.
1
Daniel Silverstone ๐๐๐๐ยฒ ๐ณ๏ธโ๐๐ฌ๐ง
@dsilverstone
15 Aug 2016
best docs for these kinds of things is 'man dash' honestly. clear, POSIX, obvious.