Shell脚本初学习
第一个shell程序运行,教程来自:http://jingyan.baidu.com/article/8cdccae947f83e315413cd05.html
代码如下:
#!/bin/sh
touch a.txt
sleep
echo "testtesttesttest">>a.txt


不知道为什么提示:MSYS2 terminal已停止工作。尚未解决。
然后用git pull的代码
#!/bin/bash
#mkdir 翟宇豪
#cd 翟宇豪
#git init
#git pull https://git.coding.net/Rio56/wf.git master declare -A map=(["冉华"]="https://git.coding.net/Dawnfox/wf.git"
["刘淑霞"]="https://git.coding.net/liusx0303/CountWords.git"
["胡佑蓉"]="https://coding.net/u/huyr000/p/countWord/git"
["王超"]="https://git.coding.net/SuperCodingChao/wfProject.git"
["高远博"]="https://coding.net/u/Rainbows/p/wc/git"
["陈建宇"]=" https://coding.net/u/MR__Chen/p/Demo/git"
["代秋彤"]="https://git.coding.net/a284617374/soft.git"
["方铭"]="https://coding.net/u/MingZi-/p/cipingtongji/git"
["葛美义"]=" https://git.coding.net/gmyznb/wordcount1.git"
["黄泽宇"]="https://coding.net/u/huangzy_95/p/wf/git"
["贾男男"]="https://git.coding.net/lynlynyess/Wordcount.git"
["贾雅杰"]="https://git.coding.net/jyj5951/wf.git"
["姜珊"]="https://coding.net/u/js2017102865/p/StreamReader/git"
["阚博文"]="https://git.coding.net/zbwd666/zbwd.git"
["李传康"]="https://git.coding.net/lick468/wf.git"
["李圆圆"]="https://git.coding.net/lyy181/count.git"
["蔺依铭"]="https://git.coding.net/Hitagi123/word-count.git"
["刘成志"]=" https://git.coding.net/liuchengzhi0944/word_dirt.git"
["刘耀泽"]="https://coding.net/u/liuyz349/p/word_count/git"
["米赫"]="https://git.coding.net/immixiaomi/wf.git"
["苗威"]="https://git.coding.net/Vrocker/wf.git"
["任思佳"]="https://coding.net/u/rensijia/p/count-words/git"
["邵朔"]="https://coding.net/u/ss505072461/p/wf/git"
["宋雨"]="https://coding.net/u/songyuu/p/python_wf/git"
["田继平"]="https://git.coding.net/tianjiping/11111.git"
["王航"]="https://git.coding.net/wangh013/wordNumber.git"
["王磊"]="https://git.coding.net/137911934/SE20170914.git"
["王伟东"]="https://git.coding.net/wangwd/SecondAssignment.git"
["王玉玲"]="https://coding.net/u/tutu123/p/tutu1234/git"
["吴雨丹"]="https://git.coding.net/clairewyd/wf.git"
["徐劭斌"]="https://git.coding.net/xushaobin/ConsoleApplication3.git"
["杨梓瑞"]="https://git.coding.net/Vector121/homework.git"
["袁玥"]="https://git.coding.net/yuanyue2017102885/wordcount_1and2.git"
["翟宇豪"]="https://git.coding.net/Rio56/wf.git"
["张恩聚"]="https://git.coding.net/ZhangEJ/wf.git"
["邹双黛"]="https://git.coding.net/szjzsd/123.git"
) for key in ${!map[@]} ; do
mkdir $key
cd $key
git init
git pull ${map[$key]} master
cd ..
done #echo ${!map[@]}
#
#echo ${map[@]}
#
# for key in ${!map[@]} ; do
# # echo ${map[$key]}
# echo $key;
# done
生成的文件夹乱码:

对shell脚本有了一点点认识,但看它也有变量定义等等,暂时还未学习。
留一个教程之后学习 http://www.runoob.com/linux/linux-shell.html
希望有遇到过此类问题的前辈帮忙解答~
Shell脚本初学习的更多相关文章
- 详细介绍Linux shell脚本基础学习
Linux shell脚本基础学习这里我们先来第一讲,介绍shell的语法基础,开头.注释.变量和 环境变量,向大家做一个基础的介绍,虽然不涉及具体东西,但是打好基础是以后学习轻松地前提.1. Lin ...
- Shell脚本编程学习入门 02
Shell脚本编程学习入门是本文要介绍的内容,我们可以使用任意一种文字编辑器,比如gedit.kedit.emacs.vi等来编写shell脚本,它必须以如下行开始(必须放在文件的第一行): #! ...
- Shell脚本的学习(二)
Shell脚本的学习(二) 方法: 1) 一个计算器: 2)递归实现打印目录 3)方法调用
- Shell脚本的学习(一)
Shell脚本的学习(一) 一)代码式shell脚本简介 1.下载 Xshell 5 建一个文件夹 mkdri home/data ; 1)查看一个在data里建一个1.sh 查看是否建立成功. 2) ...
- Linux shell脚本全面学习
Linux shell脚本全面学习 1. Linux 脚本编写基础 1.1 语法基本介绍 1.1.1 开头 程序必须以下面的行开始(必须方在文件的第一行): #!/bin/sh 符号#!用来告诉系统它 ...
- Linux shell脚本基础学习详细介绍(完整版)二
详细介绍Linux shell脚本基础学习(五) Linux shell脚本基础前面我们在介绍Linux shell脚本的控制流程时,还有一部分内容没讲就是有关here document的内容这里继续 ...
- Linux shell脚本基础学习详细介绍(完整版)一
Linux shell脚本基础学习这里我们先来第一讲,介绍shell的语法基础,开头.注释.变量和 环境变量,向大家做一个基础的介绍,虽然不涉及具体东西,但是打好基础是以后学习轻松地前提.1. Lin ...
- Shell脚本基础学习
Shell脚本基础学习 当你在类Unix机器上编程时, 或者参与大型项目如k8s等, 某些框架和软件的安装都是使用shell脚本写的. 学会基本的shell脚本使用, 让你走上人生巅峰, 才怪. 学会 ...
- Shell脚本编程学习入门 01
从程序员的角度来看, Shell本身是一种用C语言编写的程序,从用户的角度来看,Shell是用户与Linux操作系统沟通的桥梁.用户既可以输入命令执行,又可以利用 Shell脚本编程,完成更加复杂的操 ...
随机推荐
- vue 父子组件的生命周期顺序
一.加载渲染过程 父beforeCreate->父created->父beforeMount->子beforeCreate->子created->子beforeMount ...
- bootstrap世界探索2——万物的起源(网格系统)
万物的起源是非常神奇的,谁又能想到小小的细胞(文字排版)竟能构建大千世界. <!DOCTYPE html> <html lang="en"> <hea ...
- 三、spring成长之路——springIOC容器详解(上)
目录 一.springIOC 一.springIOC 控制反转和依赖注入: 简单的说就是将对象的创建,属性的的设置交给spring容器进行管理,而不再由用户自己创建,当用户需要使用该接口或者类的时 ...
- 需求:加一个下拉框选择条件改变饼图内外环 饼图:百度echarts提供
1.1:下拉框条件:后台取得ViewBag传给前台 MonitorController: public ActionResult BigData(): //下拉框筛选条件 var result = M ...
- 直流电机驱动,TIMER口配置
电机的电压输出能力和频率有关??? 修改前:------------------------------------------------------------------------------ ...
- 动手打造轻量web服务器(二)路由
tomcat启动慢?自己动手打造轻量web服务器(一) 上篇讲了怎么做一个最简单的web服务器,这篇就是在上篇加上URL路由功能(什么是路由?) 首先,根据http获得请求行 val scanner ...
- 10 Quality Free Flat Icon Sets for Your Designs
Subscribe It’s clear that flat design has gained great popularity in recent years. This is hardly su ...
- 20155203 实验三《敏捷开发与XP实践》实验报告
20155203 实验三<敏捷开发与XP实践>实验报告 一.实验内容 在IDEA中使用工具(Code->Reformate Code)把下面代码重新格式化,再研究一下Code菜单,找 ...
- switchsharp
https://www.switchysharp.com/file/switchysharp-v1.10.4.zip
- day 3 模块
1.系统自带模块 xxx.py 文件 就是模块 ### 模块存放位置 In [1]: import os In [2]: os.__file__ Out[2]: '/usr/lib/python3. ...