Cat 追加与覆盖

Cat 追加与覆盖

Cat 追加与覆盖

追加

  • cat <>
1
2
3
4
#!/bin/bash
cat << EOF >> cat.txt
vitan.me
EOF
  • cat >>
1
2
3
4
#!/bin/bash
cat >> cat.txt << EOF
vitan.me
EOF

覆盖

  • cat <>
1
2
3
4
#!/bin/bash
cat << EOF > cat.txt
vitan.me
EOF
  • cat >>
1
2
3
4
#!/bin/bash
cat > cat.txt << EOF
vitan.me
EOF

使用变量

  • Warnning
    追加和覆盖若要使用变量必须加 \\$var

  LinuxShell

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×