mac shell 初学 变量输入输出

来源:互联网 发布:dota2数据分析 编辑:程序博客网 时间:2024/06/05 17:23
#! /bin/bash
## This my first test shell
## Writen by Normanyang 2015-12-29
touch 1.sh
echo 'hello world'
date
echo '一天前日期是'`date -v -1d "+%Y:%m:%d"`
date -v +1d "+%Y%m%d"
date -v +1m "+%Y%m%d"
a=1
b=2
echo a=$a,b=$b
cp 1.sh /Users/normanyang/Documents/workspace/shellTest
echo -p "please input a number:" x
echo -p "please input another number" y
sum=$[$x+$y]
echo '相加的结果是:'$sum
0 0
原创粉丝点击