Loading, please wait...

A to Z Full Forms and Acronyms

How to demonstrate the '$#' variable in Linux Shell Script | Linux Shell Script

Mar 08, 2022 LinuxShellScript, 1714 Views
How to demonstrate the '$#' variable in Linux Shell Script | Linux Shell Script

How to demonstrate the '$#' variable in Linux Shell Script | Linux Shell Script

We will use the "$#" variable to print the total number of command-line arguments passed and print the argument total on the console screen.

#!/bin/bash

# Program name: "total_command.sh"

echo "Total command line arguments are: $#"
A to Z Full Forms and Acronyms