ademclk
ademclk

Reputation: 152

Can't pass parameters to bash script from zsh

My bash script

#!/bin/bash

 main(){
  name=${1:-you}
  echo "One for $name, one for me."
}

 main "@a"

I'm trying to pass the parameters from zsh terminal like this

bash tw_fer.sh Adem

It always returns @a nothing else. How can I print the argument that I've passed?

Upvotes: 0

Views: 236

Answers (1)

Arnaud Valmary
Arnaud Valmary

Reputation: 2325

Replace "@a" by "$1" for only first parameter or "${@}" for all parameters

Upvotes: 2

Related Questions