shell中变量的使用

cat test3:

#!/bin/bash
# testing variables
days=10
guest="Katie"
echo "$guest checked in $days days ago"
days=5
guest="Jessica"
echo "$guest checked in $days days ago"

添加可执行权限:chmod u+x test3

运行:./test3 结果如下:

Katie checked in 10 days ago
Jessica checked in 5 days ago

 

相关文章:

  • 2022-12-23
  • 2022-01-16
  • 2021-12-18
  • 2021-05-25
  • 2022-01-22
  • 2021-12-25
  • 2021-05-19
猜你喜欢
  • 2021-12-18
  • 2021-04-07
  • 2021-11-21
  • 2021-09-07
  • 2021-12-18
  • 2021-12-18
相关资源
相似解决方案