xuke123 发表于 2018-8-20 06:36:02

shell中的echo和read


  Eg:
  


[*]#!/bin/bash
[*]
[*]#echo
[*]
[*]echo –e “This echo’s 3 new lines \n\n\n”
[*]
[*]echo “ok”
[*]
[*]echo
[*]
[*]echo “This echo’s 3 new lines\n\n\n”
[*]
[*]echo “The log files have all been done”>mylogfile.txt
  


  Eg:
  


[*]#!/bin/bash
[*]#readmname
[*]echo -n "First Name:"
[*]read firstname
[*]echo -n "Last Name:"
[*]read lastname subname
[*]echo -e "your First Name is :$firstname\n"
[*]echo -e "your Last Name is :$lastname\n"
[*]echo -e "your Subname is:$subname\n"
  

  大家学会了吗?有什么不懂的地方可以给我留言。


页: [1]
查看完整版本: shell中的echo和read