第一个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脚本初学习的更多相关文章

  1. 详细介绍Linux shell脚本基础学习

    Linux shell脚本基础学习这里我们先来第一讲,介绍shell的语法基础,开头.注释.变量和 环境变量,向大家做一个基础的介绍,虽然不涉及具体东西,但是打好基础是以后学习轻松地前提.1. Lin ...

  2. Shell脚本编程学习入门 02

    Shell脚本编程学习入门是本文要介绍的内容,我们可以使用任意一种文字编辑器,比如gedit.kedit.emacs.vi等来编写shell脚本,它必须以如下行开始(必须放在文件的第一行):   #! ...

  3. Shell脚本的学习(二)

    Shell脚本的学习(二) 方法: 1) 一个计算器: 2)递归实现打印目录    3)方法调用

  4. Shell脚本的学习(一)

    Shell脚本的学习(一) 一)代码式shell脚本简介 1.下载 Xshell 5 建一个文件夹 mkdri home/data ; 1)查看一个在data里建一个1.sh 查看是否建立成功. 2) ...

  5. Linux shell脚本全面学习

    Linux shell脚本全面学习 1. Linux 脚本编写基础 1.1 语法基本介绍 1.1.1 开头 程序必须以下面的行开始(必须方在文件的第一行): #!/bin/sh 符号#!用来告诉系统它 ...

  6. Linux shell脚本基础学习详细介绍(完整版)二

    详细介绍Linux shell脚本基础学习(五) Linux shell脚本基础前面我们在介绍Linux shell脚本的控制流程时,还有一部分内容没讲就是有关here document的内容这里继续 ...

  7. Linux shell脚本基础学习详细介绍(完整版)一

    Linux shell脚本基础学习这里我们先来第一讲,介绍shell的语法基础,开头.注释.变量和 环境变量,向大家做一个基础的介绍,虽然不涉及具体东西,但是打好基础是以后学习轻松地前提.1. Lin ...

  8. Shell脚本基础学习

    Shell脚本基础学习 当你在类Unix机器上编程时, 或者参与大型项目如k8s等, 某些框架和软件的安装都是使用shell脚本写的. 学会基本的shell脚本使用, 让你走上人生巅峰, 才怪. 学会 ...

  9. Shell脚本编程学习入门 01

    从程序员的角度来看, Shell本身是一种用C语言编写的程序,从用户的角度来看,Shell是用户与Linux操作系统沟通的桥梁.用户既可以输入命令执行,又可以利用 Shell脚本编程,完成更加复杂的操 ...

随机推荐

  1. SQLServer禁用、启用外键约束

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ---启用or禁用指定表所有外键约束  alter table PUB_STRU  NOCHECK constrai ...

  2. js中的冒泡排序

    <!-- 冒泡排序:把一组数列按照一定的顺序进行排列,从大到小,或者从小到大 -->          // 控制循环的轮数          arr = [3,14,55,2,1,4,5 ...

  3. C++的六个函数

    一.构造函数 在C++中,构造函数是六个函数中的第一个,当一个对象被创建时,在它的整个周期中,是一个由生到死的 过程,即构造函数创建对象,析构函数析构对象.在对象被创建时,调用构造函数创建一个对象,这 ...

  4. 蓝桥杯第七届决赛(国赛)C++B组 第四题 机器人塔

    机器人塔 X星球的机器人表演拉拉队有两种服装,A和B.他们这次表演的是搭机器人塔. 类似: A    B B   A B A  A A B B B B B A BA B A B B A 队内的组塔规则 ...

  5. WebGl 旋转(矩阵变换)

    代码1: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF- ...

  6. jar下载地址

    java开发难免需要下载额外的jar,推荐一个地址 http://www.java2s.com/Code/Jar/CatalogJar.htm

  7. 基于 HTML5 Canvas 的 3D 渲染引擎构建机架式服务器

    前言 今天找到了 HT 的官网里的 Demo 网站( http://www.hightopo.com/demos/index.html ),看的我眼花缭乱,目不暇接. 而且 HT 的用户手册,将例子和 ...

  8. STM32 HAL库学习系列第2篇 GPIO配置

    GPIO 库函数 基本就是使用以下几个函数 GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); void H ...

  9. 适合初学Altium Designer的教学视频

    以下推荐的我都亲自看过,个人感觉确实不错,可以有助于了解流程,以及一些设计规范 首先是凡亿的PCB教学,贵是贵了点,不过也有免费的,讲解的很详细,而且还有专门的群,610359270 http://w ...

  10. SQL学习笔记:函数

    SQL函数 AVG select AVG(col) AS avgvalue from tablename select col2 from tablename where col1>(selec ...