How to make comma seperated data for cksum
find hadoop-3.0.0 -type f | xargs cksum
2840095922 951 hadoop-3.0.0/etc/hadoop/mapred-env.cmd
I have to make the result set as comma seperated like below 2840095922,951,hadoop-3.0.0/etc/hadoop/mapred-env.cmd
How to do it Thanks in advance.
Regards, Abu
First, without external tools.
IFS=$'\n'; for line in `find hadoop-3.0.0 -type f | xargs cksum`; do echo ${line// /,}; done
Second, used sed tool.
find hadoop-3.0.0/ -type f | xargs cksum | sed 's/ /,/g'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.