V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
holinhot
V2EX  ›  Linux

linux cat 查看怎么把绰号删掉了

  •  
  •   holinhot · 2015-05-08 17:09:31 +08:00 · 2746 次点击
    这是一个创建于 3295 天前的主题,其中的信息可能已经有所发展或是发生改变。

    1.txt
    "mytxt"
    "my22"
    "youweb"

    用 cat 1.txt
    结果显示的是
    mytxt
    my22
    youweb
    怎么绰号没了 怎么让他保留显示

    18 条回复    2015-05-08 21:13:39 +08:00
    lifanxi
        1
    lifanxi  
       2015-05-08 17:24:11 +08:00
    这不科学……
    暂时还没想到问题可能出在哪个环节
    est
        2
    est  
       2015-05-08 17:25:38 +08:00
    which cat
    /bin/cat
    less -nR 试试。
    LazyZhu
        3
    LazyZhu  
       2015-05-08 17:28:50 +08:00
    # cat 1.txt
    "mytxt"
    "my22"
    "youweb"
    nicai000
        4
    nicai000  
       2015-05-08 17:30:16 +08:00
    绰号 不是外号的意思么....

    你的Shell搞了什么奇怪的alias或者env吧, 新建一个用户, 进去用/bin/cat试试
    holinhot
        5
    holinhot  
    OP
       2015-05-08 17:31:26 +08:00
    @lifanxi
    @est
    @LazyZhu
    我搞错了 直接cat是正确的 我用这个他绰号才消失

    cat /tmp/1.txt | xargs -i echo {}
    Csineneo
        6
    Csineneo  
       2015-05-08 17:31:36 +08:00
    綽號...
    holinhot
        7
    holinhot  
    OP
       2015-05-08 17:32:20 +08:00
    @nicai000 haha 绰号确实是外号
    holinhot
        8
    holinhot  
    OP
       2015-05-08 17:32:55 +08:00
    @Csineneo 这是重点嘛
    Csineneo
        9
    Csineneo  
       2015-05-08 17:39:16 +08:00
    @holinhot 這才是重點,我就是被這個詞吸引進來的 =.=!
    mrco
        10
    mrco  
       2015-05-08 17:40:29 +08:00
    cat 1.txt|sed 's/\"//g'
    holinhot
        12
    holinhot  
    OP
       2015-05-08 18:01:17 +08:00
    @LazyZhu 这个是echo我的是从文本读啊
    holinhot
        13
    holinhot  
    OP
       2015-05-08 18:10:42 +08:00
    @LazyZhu 好像是这个样子cat domain_list.txt | xargs -i echo '"{}"'
    rcmerci
        14
    rcmerci  
       2015-05-08 18:48:59 +08:00
    绰号??
    lilydjwg
        15
    lilydjwg  
       2015-05-08 19:09:55 +08:00
    因为这是 xargs 预期的行为:

    This manual page documents the GNU version of xargs. xargs reads items
    from the standard input, delimited by blanks (which can be protected
    with **double or single quotes or a backslash**) or newlines, and executes
    the command (default is /bin/echo) one or more times with any initial-
    arguments followed by items read from standard input. Blank lines on
    the standard input are ignored.
    lilydjwg
        16
    lilydjwg  
       2015-05-08 19:10:32 +08:00
    PS: 使用 -d 指定分隔符的话,引号和反斜杠就不特殊对待了。
    jasontse
        17
    jasontse  
       2015-05-08 19:34:00 +08:00 via Android
    这年头有人不认识双引号?
    kchum
        18
    kchum  
       2015-05-08 21:13:39 +08:00 via iPhone
    我疑惑了“绰号”
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1195 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 18:30 · PVG 02:30 · LAX 11:30 · JFK 14:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.