bash pass command line arguments - Propagate all arguments in a bash shell script

bash script arguments / bash / command-line-arguments

I am writing a very simple script that calls another script, and I need to propagate the parameters from my current script to the script I am executing.

bar $1 $2 $3 $4

codeforester



Answer #1
#!/usr/bin/env bash
while [ "$1" != "" ]; do
  echo "Received: ${1}" && shift;
done;