pass Args to bash Script in terminal

#! /bin/bash

echo "Your Args Variables are: $0 $1 $2 $3"

#Pass Args as Array elements:

args=("$@")

echo "Args Var...: ${args[0]} , ${args[1]} , ${args[2]}"

#Prints all args Variables

echo $@

#Prints number of args

0
Subscribe to my newsletter

Read articles from Omkar Venkatrao Punjaji directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Omkar Venkatrao Punjaji
Omkar Venkatrao Punjaji

Linux , Devops , c , c++ , python