第一个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. PHP设置Redis key在当天有效|SCP对拷如何连接指定端口(非22端口)的远程主机

    $redis->set($key,$value); $expireTime = mktime(23, 59, 59, date("m"), date("d" ...

  2. js 实现内容的展开和收缩

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  3. 追溯了解Ubuntu之------基本命令操作(叁)

    在使用Ubuntu中的一些基本命令与Linux中是有区别的: 1.       查看Ubuntu系统位数:uname  -ar 或 getconf LONG_BIT 2.          获取Ubu ...

  4. Redis之Redis消息订阅发布简介

    概念: Redis消息订阅发布是进程间的一种消息通信模式,发送者pub发送消息,订阅者sub接收消息. 使用须知: 需要先订阅后发布,才能接收到消息.在订阅时,相当于创建了可供发布的频道. 案例: ( ...

  5. python学习笔记(二)python基础知识(list,tuple,dict,set)

    1. list\tuple\dict\set d={} l=[] t=() s=set() print(type(l)) print(type(d)) print(type(t)) print(typ ...

  6. HIVE—数据仓库

    1. hive是什么? Hive是基于 Hadoop 的一个数据仓库工具: 1.       hive本身不提供数据存储功能,使用HDFS做数据存储: 2.       hive也不分布式计算框架,h ...

  7. goland实现函数式链式编程

    先来看一段代码 package main import ( "fmt" elastic "gopkg.in/olivere/elastic.v2" ) type ...

  8. Linux IO多路复用 poll

    Linux IO多路复用 poll 之前曾经提到过 select poll 跟select类似,poll改进了select的一个确定,就是poll没有监听上限 不过poll还是需要遍历以及频繁的把数组 ...

  9. 《Java核心技术36讲》阅读笔记:Exception和Error有什么区别?

    1.Exception 和 Error有什么区别?运行时异常与一般异常有什么区别? Exception和Error都继承自java.lang.Throwable.在Java中只有Throwable的实 ...

  10. 20155217 2016-2017-2 《Java程序设计》第10周学习总结

    20155217 2016-2017-2 <Java程序设计>第10周学习总结 教材学习内容总结 网络编程 网络编程就是在两个或两个以上的设备(例如计算机)之间传输数据. 程序员所作的事情 ...