`
yaojingguo
  • 浏览: 208173 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

$#, $* and $@ in bash

阅读更多

This is little script shows the usage of $#, $* and $@ in bash.

 

#!/bin/bash

function countargs {
    echo "$# args."
}

echo "$*"
countargs "$*"
countargs "$@"
 
分享到:
评论

相关推荐

    Sams Teach Yourself Shell Programming in 24 Hours

    - 最初由Steve Bourne为PWB/UNIX(Porter and McIlroy’s UNIX)设计了Bourne Shell (sh)。 - 随后出现了更多类型的Shell,如C Shell (csh) 由Bill Joy开发,以及Korn Shell (ksh) 由David Korn创建等。 ##### **...

    man bash 中文PDF 版

    - **版权信息**: Bash 的版权属于 1989-2002 年间的 Free Software Foundation, Inc.。 - **描述**: BASH 是一个与 sh 兼容的命令解释程序,能够执行来自标准输入或文件中的命令。它还融合了 Korn Shell (ksh) 和 C ...

    Linux for Developers

    * **Bash, Python, and Perl:** Introduces scripting tools such as Bash, Python, and Perl, enabling developers to automate repetitive tasks and write powerful scripts. * **Object-Oriented Programming ...

    shell编程实例

    - **变量 `#$`**:表示传递给脚本的所有参数的数量。 - **变量 `$$`**:表示当前正在运行的进程的ID。 **应用示例:** 假设执行该脚本时命令为 `./script.sh arg1 arg2 arg3`,则输出结果将包含: - 当前命令是 `./...

    Linux Administration A Beginner's Guide 5ed.pdf

    - **Automation and Scripting:** Introduction to scripting languages like Bash and Python, and tips for automating repetitive tasks. #### Additional Resources Throughout the book, the authors provide ...

    Bash参考手册(Linux Shell),简单的页面中,有BASH的基本用法,非常方便

    ### Bash参考手册(Linux Shell)知识点详解 #### 一、算术运算符 在Bash脚本中,可以通过以下方式来进行基本的算术运算: - **加法**:`$var=$((20+5))` 或 `$expr1+3` - **减法**:`$expr2-1` - **乘法**:`$...

    Bash Quick Reference bash命令快速指南

    ### Bash Quick Reference – bash命令快速指南 #### 一、简介 本快速指南旨在为用户提供一个简洁而实用的bash命令手册,适用于版本2.02.0。它由Arnold Robbins编写,并得到了bash维护者Chet Ramey的帮助。这份手册...

    Linux Bash Guide Beginner

    - **Features only found in bash**:列举了一些仅在Bash中提供的特色功能,如别名支持、命令历史等功能。 #### 1.3 执行命令 - **General**:概括了执行命令的基本流程。 - **Shell built-in commands**:介绍了...

    doxygen配置及使用手册

    * @brief Processes the received SIP message and sends it to the remote client. * @param buf The received SIP message buffer. * @retval TRUE if successful, FALSE otherwise. */ int udp_process_...

    groovy_in_action_draft_ch_01.pdf

    Groovy is a great scripting language, offering a rich set of built-in features and libraries that make it easy to write concise and expressive scripts. It is particularly useful for automating tasks, ...

    shell cheat sheet

    This cheat sheet provides a comprehensive overview of essential shell commands, constructs, and utilities commonly used in UNIX/Linux environments. It is designed to serve as a quick reference guide ...

    bash-door分析

    * Then it will compile and install the new bash shell on the system. * * [2] BD will Compile SeCshell.c to /tmp/mclzaKmfa * * [3] BD will exit. * * For further information on Trojan, read the ...

    Bash Quick Reference

    ### Bash 快速参考知识点概览 #### 一、简介 Bash(Bourne-Again SHell)是一种广泛使用的Unix shell 和命令语言。本文档是针对Bash 2.02.0版本的快速参考指南,由Arnold Robbins编写,并感谢Chet Ramey(Bash维护...

    高级Bash脚本编程指南

    ### 高级Bash脚本编程指南 #### Introduction 本文档旨在为读者提供关于Bash脚本编程的深入理解与实践技巧。Bash是Unix和Linux操作系统中最常用的shell之一,其强大的功能支持使得Bash脚本成为自动化任务、数据...

    Pro Bash Programming

    * Complete bash coverage * Teaches bash as a programming language * Helps you master bash 4.0 features What you'll learn * Use the shell to write new utilities and accomplish most programming tasks....

    bash Cookbook: Solutions and Examples for bash Users, 2nd Edition

    But beneath this simple promise lies a treacherous ocean of variations in Unix commands and standards. This thoroughly revised edition of bash Cookbook teaches shell scripting the way Unix masters ...

    go 1.9 源码

    where the details on the last few lines reflect the operating system, architecture, and root directory used during the install. For more information about ways to control the build, see the ...

Global site tag (gtag.js) - Google Analytics