需要处理的文本内容如下:
[root@db-read1 ~]# cat 5.txt
12021012910058460004
12021012810086009004
82021013010077270001
82021013010122917003
12021013010153074001
1HH202101310991143
12021013110169858002
12021013110169858003
3021012910165310001
12021013110105288003
12021013110105288004
2021013110154350004

实现结果就是:

'12021012910058460004' '12021012810086009004' '82021013010077270001' '82021013010122917003' '12021013010153074001' '1HH202101310991143' '12021013110169858002' '12021013110169858003' '3021012910165310001' '12021013110105288003' '12021013110105288004' '2021013110154350004'
放到一行展示出来,要求单引号直间有空格

实现命令如下:

[root@db-read1 ~]#  cat 5.txt |awk '{print " " $0}'|sed -e "s/ /\'/g"|sed -e "s/\'/'/g" |paste -d " " -s -
'12021012910058460004' '12021012810086009004' '82021013010077270001' '82021013010122917003' '12021013010153074001' '1HH202101310991143' '12021013110169858002' '12021013110169858003' '3021012910165310001' '12021013110105288003' '12021013110105288004' '2021013110154350004'

[root@db-read1 ~]#  cat 5.txt |awk '{print " " $0}'|sed -e "s/ /\'/g"|sed -e "s/\'/'/g" |tr -s "\n" " ";echo
'12021012910058460004' '12021012810086009004' '82021013010077270001' '82021013010122917003' '12021013010153074001' '1HH202101310991143' '12021013110169858002' '12021013110169858003' '3021012910165310001' '12021013110105288003' '12021013110105288004' '2021013110154350004'

参考文章:
https://blog.51cto.com/bad51men/1149973