Globbing/pathname expansion with colon as separator

前端 未结 8 1295
鱼传尺愫
鱼传尺愫 2020-12-28 16:23

How can I convert a string containing glob characters such as

/var/lib/gems/*/bin

into a colon-separated string of filenames (i.e. PATH com

8条回答
  •  醉梦人生
    2020-12-28 16:46

    Another oneliner: printf "%s\n" /var/lib/gems/*/bin | paste -s -d':'

    But @timo's answer is better in my opinion.

提交回复
热议问题