So i have this program in Shell Script its basic but what i want is to read 3 values from the stdin while i start the program and then i want to print those values but for some reason it gives an error.
Expected output:
./my_script.sh hello bye 2
hello
bye
2
my output:
./my_script.sh hello bye 2
Word1=1
meu_script.sh: line 2: read: `Word2=': not a valid identifier
hello
bye
2
Program:
#!/bin/bash
read -p "Word1=" $1 "Word2=" $2 "Num=" $3
Word1="${1}"
Word2="${2}"
Num="${3}"
echo ${1}
echo ${2}
echo ${3}
Can someone explain me whats going because i dont understand btw im fairly knew in programming in shell script