如何在保留制表符的同时从UNIX shell中将制表符分隔的文本复制到剪贴板? [英] How to copy tab-delimited text to clipboard from within a unix shell while preserving the tabs?

查看:147
本文介绍了如何在保留制表符的同时从UNIX shell中将制表符分隔的文本复制到剪贴板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将UNIX环境中的文件的几行复制并粘贴到网页中.我想通过破坏选项卡来保留原始格式.但是,当我选择一个文本块并将其复制并粘贴到网页中时,所有选项卡都已转换为各种长度的空格.

I am trying to copy and paste a few lines of a file from within a UNIX environment into a webpage. I want to preserve the original formatting with disrupting the tabs. However, when I select a block of text and copy and paste it into a webpage, all of the tabs have been converted to various length runs of spaces.

有人可以告诉我如何保存原始标签吗?它必须尽可能简单,以便新手用户可以执行相同的操作!

Can someone please tell me what I can do to preserve the original tabs? It needs to be as simple as possible so that newbie users can do the same!

谢谢

推荐答案

基于您的评论,您正在复制的文本缺少选项卡,我怀疑您使用的ptty已为您转换了它们.我怀疑如果您运行"stty选项卡",则可能会得到所需的行为(通过在ptty中禁用选项卡扩展).

Based on your comment that the text that you're copying is missing the tabs, I suspect that the ptty you're using has converted them for you. I suspect if you run "stty tabs", you may get the behavior you're looking for (by disabling tab expansion in the ptty).

这篇关于如何在保留制表符的同时从UNIX shell中将制表符分隔的文本复制到剪贴板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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