xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

pbcopy garbled bug All In One

pbcopy garbled bug All In One

garbled / 乱码

image

$  man tr |  pbcopy

$  man brew |  pbcopy

https://www.cnblogs.com/xgqfrms/p/16875976.html

https://github.com/xgqfrms/linux/issues/20#issuecomment-1310740456

pbcopy 妙用

# 复制 ps 命令文档
$ man ps | pbcopy

# 复制 ls 命令文档
$ man ls | pbcopy

# 复制 pbcopy 命令文档
$ man pbcopy | pbcopy

https://www.cnblogs.com/xgqfrms/p/16560423.html

demos

image

# ❌
$ man tr | pbcopy


TR(1)                        General Commands Manual                       TR(1)

NNAAMMEE
     ttrr – translate characters

SSYYNNOOPPSSIISS
     ttrr [--CCccssuu] _s_t_r_i_n_g_1 _s_t_r_i_n_g_2
     ttrr [--CCccuu] --dd _s_t_r_i_n_g_1
     ttrr [--CCccuu] --ss _s_t_r_i_n_g_1
     ttrr [--CCccuu] --ddss _s_t_r_i_n_g_1 _s_t_r_i_n_g_2

DDEESSCCRRIIPPTTIIOONN
     The ttrr utility copies the standard input to the standard output with
     substitution or deletion of selected characters.

     The following options are available:

     --CC      Complement the set of characters in _s_t_r_i_n_g_1, that is “--CC ab”
             includes every character except for ‘a’ and ‘b’.

     --cc      Same as --CC but complement the set of values in _s_t_r_i_n_g_1.

     --dd      Delete characters in _s_t_r_i_n_g_1 from the input.

     --ss      Squeeze multiple occurrences of the characters listed in the last
             operand (either _s_t_r_i_n_g_1 or _s_t_r_i_n_g_2) in the input into a single
             instance of the character.  This occurs after all deletion and
             translation is completed.

     --uu      Guarantee that any output is unbuffered.

# ...
SSTTAANNDDAARRDDSS
     The ttrr utility conforms to IEEE Std 1003.1-2001 (“POSIX.1”).  The
     “ideogram”, “phonogram”, “rune”, and “special” character classes are
     extensions.

     It should be noted that the feature wherein the last character of _s_t_r_i_n_g_2
     is duplicated if _s_t_r_i_n_g_2 has less characters than _s_t_r_i_n_g_1 is permitted by
     POSIX but is not required.  Shell scripts attempting to be portable to
     other POSIX systems should use the “[#*]” convention instead of relying on
     this behavior.  The --uu option is an extension to the IEEE Std 1003.1-2001
     (“POSIX.1”) standard.

macOS 12.3                      October 13, 2006                      macOS 12.3

image

# ❌
$ man ps | pbcopy


PS(1)                        General Commands Manual                       PS(1)

NNAAMMEE
     ppss – process status

SSYYNNOOPPSSIISS
     ppss [--AAaaCCccEEeeffhhjjllMMmmrrSSTTvvwwXXxx] [--OO _f_m_t | --oo _f_m_t] [--GG _g_i_d[,_g_i_d_._._.]]
        [--gg _g_r_p[,_g_r_p_._._.]] [--uu _u_i_d[,_u_i_d_._._.]] [--pp _p_i_d[,_p_i_d_._._.]] [--tt _t_t_y[,_t_t_y_._._.]]
        [--UU _u_s_e_r[,_u_s_e_r_._._.]]
     ppss [--LL]



     The following environment variables affect the execution of ppss:

     COLUMNS      If set, specifies the user's preferred output width in column
                  positions.  By default, ppss attempts to automatically determine
                  the terminal width.

# ...

SSEEEE AALLSSOO
     kill(1), w(1), kvm(3), strftime(3), sysctl(8)

SSTTAANNDDAARRDDSS
     The ppss utility supports the Version 3 of the Single UNIX Specification
     (“SUSv3”) standard.

HHIISSTTOORRYY
     The ppss command appeared in Version 4 AT&T UNIX.

BBUUGGSS
     Since ppss cannot run faster than the system and is run as any other
     scheduled process, the information it displays can never be exact.

     The ppss utility does not correctly display argument lists containing
     multibyte characters.

macOS 12.3                       March 20, 2005                       macOS 12.3


solution

use vscode to fix copy from terminal encoding bug 🚀

修复 macOSterminal 导出 man 手册到 markdown 文件的时候,vscode 中显示出现的乱码 bug 🚀

vscode 全部选中 " 符号,连续两次删除后,保存即可!✅

image

refs

https://stackoverflow.com/questions/74505387/is-this-a-pbcopy-command-garbled-bug



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2022-11-11 13:26  xgqfrms  阅读(27)  评论(4编辑  收藏  举报