脚本在文本文件中列出了所有不同的字符 [英] Scripts for listing all the distinct characters in a text file

查看:102
本文介绍了脚本在文本文件中列出了所有不同的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如

给定一个文件 input.txt的,它具有以下内容:

Given a file input.txt, which has the following content:

He likes cats, really?

输出将会是这样的:

the output would be like:

H
e

l
i
k
s
c
a
t
,
r
l
y
?

请注意在输出的字符的顺序并不重要。

Note the order of characters in output does not matter.

推荐答案

如何

echo "He likes cats, really?" | fold -w1 | sort -u

这篇关于脚本在文本文件中列出了所有不同的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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