V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
gIrl1990
V2EX  ›  问与答

MacOS(UNIX): `col` 这个命令的源码在哪?如何找到最新版?

  •  
  •   gIrl1990 · 2019-09-05 14:25:09 +08:00 · 1113 次点击
    这是一个创建于 1696 天前的主题,其中的信息可能已经有所发展或是发生改变。
    • 就重定向到文件的时候,有些内容带 控制字符 , col 就可以移除掉,我不知道对不对网上看来的,有其它好方法求赐教,比如 man find >m-find.txt 或者 `tree -L 1 >tree-1.txt
    • col 这个命令的源码在哪?如何找到最新版?
    NAME
         col -- filter reverse line feeds from input
    
    SYNOPSIS
         col [-bfhpx] [-l num]
    
    DESCRIPTION
         The col utility filters out reverse (and half reverse) line feeds so that the output is in the correct order with only forward and half forward line feeds, and replaces white-space characters with tabs where possible.  This can be useful in processing the output of nroff(1) and tbl(1).
    
    HISTORY
         A col command appeared in Version 6 AT&T UNIX.
    
    第 1 条附言  ·  2019-09-05 19:25:53 +08:00
    第 2 条附言  ·  2019-09-06 19:18:33 +08:00

    Fixed: tree -NL 2 ~ >tree-2.txt

    man 的话,暂不知道,你比如说从 https://github.com/man-pages-zh/manpages-zh 随便找一个带中文的。macos man 查看失败。

    6 条回复    2019-09-05 20:25:50 +08:00
    gIrl1990
        2
    gIrl1990  
    OP
       2019-09-05 16:37:21 +08:00
    @ysc3839 `tree -L 2 ~ >tree-2.txt` 会报 `col: Illegal byte sequence` 错误,源码找不到 `Illegal` 字样,233
    xml123
        3
    xml123  
       2019-09-05 16:45:18 +08:00
    直接替换 ascii 小于 32 的字符不行吗
    ysc3839
        4
    ysc3839  
       2019-09-05 17:33:59 +08:00
    gIrl1990
        5
    gIrl1990  
    OP
       2019-09-05 19:26:12 +08:00
    @xml123 怎么写?😜
    gIrl1990
        6
    gIrl1990  
    OP
       2019-09-05 20:25:50 +08:00
    命令没写全,是
    `man find | col -b >m-find.txt`
    `tree -L 2 ~ | col -b >tree-2.txt`
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2928 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 07:58 · PVG 15:58 · LAX 00:58 · JFK 03:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.