2024: A Landmark Year for Global Crypto Regulation
A to Z Full Forms and Acronyms

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

Mar 08, 2022 LinuxShellScript, 1991 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
Cookies.

By using this website, you automatically accept that we use cookies. What for?

Understood