举例说:
脚本名称叫test.sh 入参三个: 1 2 3
运行test.sh 1 2 3后
$*为"1 2 3"(一起被引号包住)
$@为"1" "2" "3"(分别被包住)
$#为3(参数数量) 如脚本:
#!/bin/sh
for loop in "$*"
  do
  echo $loop
  done 输出循环一次: 1 2 3 另一脚本: #!/bin/sh
for loop in "$@"
  do
  echo $loop
  done
输出循环三次:
  1
  2
  3

随机推荐

  1. STM32F103各PIN脚封装图

    1.36PIN 2.48PIN 3.64PIN 4.100PIN STM32ZET6详细pin脚图

  2. Flash OS images to SD cards & USB drives & TF cards safely and easily using etcher

    install tools: wget https://github.com/resin-io/etcher/releases/download/v1.4.5/etcher-cli-1.4.5-lin ...

  3. flask+APScheduler 任务调度,计划任务,定时任务

    from flask import Flask from flask_apscheduler import APScheduler # 引入APScheduler from test124 impor ...

  4. JAXP/DOM demo

    body, table{font-family: 微软雅黑; font-size: 10pt} table{border-collapse: collapse; border: solid gray; ...

  5. 在 Ubuntu 14.04 Chrome中安装Flash Player(转)

    在 Ubuntu 14.04 中安装 Pepper Flash Player For Chromium  一个 Pepper Flash Player For Chromium 的安装器已经被 Ubu ...

  6. SWIFT中用Switch case 类类型

    有时觉得SWIFT的语法真的强大而又变态,不说了,直接上代码瞅瞅: 首先先定义一个交通工具的父类 class Vehicle{ var wheels:Int! var speed:Double! in ...

  7. ubuntu18.04 server配置静态ip (转载)

    原文地址: https://blog.csdn.net/mossan/article/details/80381679 最新发布的ubuntu18.04 server,启用了新的网络工具netplan ...

  8. Texas Instruments matrix-gui-2.0 hacking -- submenu.php

    <?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...

  9. 王垠:完全用Linux工作 - imsoft.cnblogs

    完全用Linux工作,抛弃windows 我已经半年没有使用 Windows 的方式工作了.Linux 高效的完成了我所有的工作. GNU/Linux 不是每个人都想用的.如果你只需要处理一般的事务, ...

  10. HihoCoder - 1781: Another Bubble Sort (冒泡排序&逆序对)

    Sample Input 3 9 8 7 5 1 9 2 6 4 3 1 2 3 4 5 6 7 8 9 9 8 7 5 1 9 2 6 4 3 1 2 5 4 3 6 7 8 9 9 8 7 5 1 ...