第一个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. 19-3-15Python中闭包,迭代器,递归

    函数名的使用 函数名可以当作值赋值给变量 函数名可以当作元素放到容器里 闭包 一个嵌套函数 在嵌套函数内的函数使用外部(非全局的变量) 满足以上两条就是闭包 python中闭包,会进行内存驻留,普通函 ...

  2. swiper插件几个容易忽略的地方

    以下内容为swiper4版本的 1.在我们用swiper插件做轮播的当我们左右滑动后会出现自动轮播停止了 此时我们需要在autoplay中 加上这个属性 autoplay:{ delay:1000, ...

  3. php图片上传存储源码,可实现预览

    <?php header("content-Type: text/html; charset=gb2312"); $uptypes=array('image/jpg', // ...

  4. 使用for in 循环数据集

    在DELPHI没有FOR IN的语法时,我们要使用如下代码枚举数据集中的每个内容: cds.First; while not cds.eof do begin ... cds.Next; end; 最 ...

  5. 浏览器窗口输入网址后发生的一段事情(http完整请求)

    1.DNS查询得到IP 输入的是域名,需要进行dns解析成IP,大致流程: 如果浏览器有缓存,直接使用浏览器缓存,否则使用本机缓存,再没有的话就是用host 如果本地没有,就向dns域名服务器查询(当 ...

  6. python学习笔记:第10天 函数进阶和作用域

    目录 1. 函数进阶 2. 命名空间 3. 关键字global和nonlocal 1. 函数进阶 动态接收位置参数 之前写的函数都是固定参数的,假设有个函数需要的参数由几十个,一个个写在形参的位置会非 ...

  7. shiro实战整合

    引入依赖(包括缓存等): <!-- SECURITY begin --> <dependency> <groupId>org.apache.shiro</gr ...

  8. 20155235 2017-2018-1 《Java程序设计》第2周学习总结

    20155235 2017-2018-1 <Java程序设计>第2周学习总结 教材学习内容总结 3.1类型.变量与运算符 类型 基本类型 类类型 变量 基本规则 不可以用数字作为开头,不可 ...

  9. 成都Uber优步司机奖励政策(4月11日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  10. .NET core 项目部署在windows 服务器方法以及iis 访问报 500.19错误的解决办法

    将本地发布的服务本地运行没问题,发布上云windows 服务器就报 500.19 0x8007000d 是因为云服务器没有安装.net core相关的插件,比如.NET CORE sdk等,请按照该文 ...