Loading, please wait...

A to Z Full Forms and Acronyms

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

Jun 24, 2021 LinuxShellScript, 377 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