unix 连接分隔符 [英] unix join separator char

查看:30
本文介绍了unix 连接分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

抱歉问了一个可能微不足道的问题.

Sorry for the maybe trivial question.

我对 unix join 命令进行了一些尝试,试图将制表符而不是空格作为默认分隔符.-t 是参数,但这些不起作用(ubuntu 9.10 64 位 2.6.31-14,GNU coreutils 7.4 版)

I fought a bit with the unix join command, trying to get tabs instead of whitespaces as the default separators. -t is the argument, but these don't work (ubuntu 9.10 64 bit 2.6.31-14, GNU coreutils version 7.4)

join file1 file2 -t"	"
join file1 file2 -t="	"
join file1 file2 -t="\t"
join file1 file2 -t $"	"

等等.当然,我总是可以使用一些不雅的解决方案,例如

Et cetera. Of course, I can always use some inelegant solution like

join file1 file2 > output
sed "s/ /	/g" output

但我想看起来很聪明:-) 此外,如果有 -t 参数,它必须有效.

But I wanted to look smart :-) Moreover, if there's a -t argument, it must work.

推荐答案

我认为它需要一个动态生成的变量

I think it takes a variable generated on-the-fly

试试

join file1 file12 -t $'	'

这篇关于unix 连接分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆