码迷,mamicode.com
首页 > 其他好文 > 详细

Sheel 脚本接收键盘输入

时间:2021-02-18 13:13:07      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:定义   col   键盘输入   read   接收   rgba   span   权限   style   

一、通过read 接收

1. 通过vim 定义一个test.sh的脚本

vim test.sh

2. 编写shell脚本

#! /bin/bash
read name
echo "$name It is a test"

3. 添加脚本执行权限

chmod +x test.sh 

4. 执行脚本

[root@test-29 ~]# ./test.sh 
OK
OK It is a test

 

Sheel 脚本接收键盘输入

标签:定义   col   键盘输入   read   接收   rgba   span   权限   style   

原文地址:https://www.cnblogs.com/dairenblog/p/14406049.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!