如果代码中有制表符,会发生什么情况?
可将制表符转换成空格的选项。
避免在示例代码行的开始使用制表符。
s——空白字符,如制表符或换行符。
由逗号或制表符分隔的文本。
代码中不应该有制表符。
默认的字段分隔符是制表符。
空白(空格或制表符)。
使用两个空格表示缩进,而且绝不使用制表符。
清单11展示如何使用tr将空格转换为制表符。
d——允许我们指定其他分隔符,而不是制表符。
有时候,您可能希望将制表符替换为空格,或者相反。
Sometimes you may want to swap tabs for Spaces or vice versa.
可以使用制表符来标记缩进,但是一般推荐使用空格。
You can use tab characters to mark the indentation, but it's generally recommended that you use spaces.
设置一个单一值,它将以此为间隔设置重复的制表符。
其中一些选项控制它输出非打印字符的方式,例如制表符和控制字符。
Some of them control the way it outputs nonprinting characters, such as tabs and control characters.
其他格式包括名称-值对格式、制表符分隔的格式以及固定宽度的格式。
Others formats include name and value pairs, tab-separated, and fixed-width formats.
回忆一下,我们前面使用tr命令将text1中的空格修改为制表符。
Remember earlier we used the tr command to change blanks in text1 to tabs.
cat的- a选项提供了另一种方法来查看制表符和行结束符的位置。
The -a option of cat provides an alternate way of seeing where your tabs and line endings are.
也可处理以空格、分号、制表符、回车或任何其他可识别字符分隔的列表。
A list separated by Spaces, semicolons, tabs, carriage returns, or any other identifiable character can be processed.
除非您指定了一个不同的字段分隔符,否则将使用空格或制表符分隔字段。
Unless you specify a different field separator, fields are delimited by blanks or tabs.
但您不知道单词由什么分隔,是空格、换行符、制表符还是这些字符的组合。
But you don't know whether the words are separated by Spaces, line breaks, tabs, or some combination of these.
cat还可以在您查看包含如制表符这样的非打印字符的文件时起帮助作用。
Cat can also help when you are viewing files that contain non-printing character like tabs. You can reveal them with these options.
否则其他补全将不可行,因此它通过返回一个制表符来充当正常的tab键。
Otherwise, no completion was possible, so it falls back to acting like a normal TAB key, by returning a literal TAB character.
在创建text1和text2文件时,我们使用制表符创建了text2。
When we created our text1 and text2 files, we created text2 with TAB characters.
要通过文本文件向数据库填入数据,需要创建一个以制表符定界的文件。
To populate tables in your database from a text file, you need to create a TAB delimited file.
修正混合制表符——会提示开发人员修正混合了制表符和空格的代码文件。
Fix Mixed tabs - Prompts to fix files that mix tabs and Spaces.
这种方法删除代码中所有不必要的字符,比如制表符(tab)、新行和空格。
Minification removes from the code all the unnecessary characters, such as tabs, newlines, and Spaces.
我们曾经在清单9中创建了一个强制制表符,您可以从中看到命令替换的例子。
You saw an example of command substitution in Listing 9 when we created a captive TAB character.
在图3中,用红色高亮显示repeat后面的制表符;这明确地警告用户这里有错误。
In Figure 3, the TAB just after repeat is highlighted in red; a clear flag to the user that something is wrong.
在此之后,如果在一行的开头输入空格或制表符,那么后续的新行将会缩进到相同的位置。
From this point on, if you use leading spaces or tabs in a line, subsequent new lines will be indented to the same place.
应用推荐