Multiple strings, Truncate line at 80 characters

前端 未结 5 842
无人共我
无人共我 2021-02-02 05:57

I\'m new to awk and sed, and I\'m looking for a way to truncate a line at 80 characters, but I\'m printing several strings in that line using printf. The last two strings are th

5条回答
  •  不知归路
    2021-02-02 06:13

    I had the same issue trying to customize my bash prompt with a truncated directory name. What finaly worked was:

    PS1='\u@\h:`echo $(basename $PWD) | cut -c 1-15`\$ '
    

提交回复
热议问题