手记

shell下文件内容拼接,用逗号分隔

[root@node1 ~]# cat tableName.txt hello
hadoop
spark
mapreduce
storm
python

[root@node1 ~]#

要达到的效果
hello,hadoop,spark,mapreduce,storm,python

[root@node1 ~]#  echo `(cat tableName.txt)` | sed 's/ /,/g'hello,hadoop,spark,mapreduce,storm,python
[root@node1 ~]#
 echo `(cat tableName.txt)` | sed 's/ /,/g'



作者:Mr_Alfred
链接:https://www.jianshu.com/p/2339c7ad7738
x


0人推荐
随时随地看视频
慕课网APP