7.Shell 传递参数
Shell 传递参数
1.#!/bin/bash
2.
3.echo "Shell 传递参数实例!";
4.echo "执行的文件名:$0";
5.echo "第一个参数为:$1";
6.echo "第二个参数为:$2";
7.echo "第三个参数为:$3";1.$ chmod +x test.sh
2.$ ./test.sh 1 2 31.Shell 传递参数实例!
2.执行的文件名:./test.sh
3.第一个参数为:1
4.第二个参数为:2
5.第三个参数为:3Last updated