Type null character in terminal

前端 未结 4 2051
深忆病人
深忆病人 2021-01-04 04:32

Is there a way to type the null character in the terminal?

I would like to do something like:

this is a sentence (null) test123
4条回答
  •  时光取名叫无心
    2021-01-04 05:12

    $ echo -e "this is a sentence \0 test123"
    this is a sentence  test123
    

    The null here ^^ IS NOT visible

    $ echo -e "this is a sentence \0 test123" | cat --show-nonprinting
    this is a sentence ^@ test123
    

    But it IS here ^^

    But maybe you did not want this for a script?

提交回复
热议问题