Pipe output to bash function

前端 未结 7 1054
故里飘歌
故里飘歌 2020-11-29 21:11

I have as simple function in a bash script and I would like to pipe stdout to it as an input.

jc_hms(){
  printf \"$1\"
}

I\'d like to use

7条回答
  •  再見小時候
    2020-11-29 21:44

    Or, you can also do it in a simple way.

    jc_hms() {
        cat
    }
    

    Though all answers so far have disregarded the fact that this was not what OP wanted (he stated the function is simplified)

提交回复
热议问题