How to duplicate string in bash?

前端 未结 4 1947
臣服心动
臣服心动 2020-12-22 02:32

I have the following string in bash

str=\"kallel\"

I want to create from str an str2. The str2 conta

4条回答
  •  清歌不尽
    2020-12-22 03:13

    I am 100% stealing this answer from Bash : Duplicate a string variable n times but I thought it bore repeating (despite being on a 6 year old question):

    $ yes "kallel" | head -20  | xargs | sed 's/ //g' | cut -c1-20
    kallelkallelkallelka
    

提交回复
热议问题