SPRINTF in shell scripting?

后端 未结 3 1278
时光取名叫无心
时光取名叫无心 2020-12-24 05:26

I have an auto-generated file each day that gets called by a shell script. But, the problem I\'m facing is that the auto-generated file has a form of:

FIL         


        
3条回答
  •  清歌不尽
    2020-12-24 05:53

    Try:

    sprintf() { local stdin; read -d '' -u 0 stdin; printf "$@" "$stdin"; }
    

    Example:

    $ echo bar | sprintf "foo %s"
    foo bar
    

提交回复
热议问题