ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 多行合并

多行合并

原创 Linux操作系统 作者:fjzcau 时间:2015-01-24 09:41:44 0 删除 编辑
# cat -A  user_passwd.txt
test:123$
$
$
oracle:1$
$
$
$

# awk '{printf "%s ",$0}' user_passwd.txt
test:123   oracle:1   

# cat user_passwd.txt  |  tr -s "\n"    " "
test:123 oracle:1

# echo `cat user_passwd.txt`
test:123 oracle:1

# while read line; do echo -n $line\ ; done < user_passwd.txt
test:123   oracle:1    

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22661144/viewspace-1412888/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-04-03

  • 博文量
    208
  • 访问量
    547178