#!/bin/bash
array=($1 $2 $3 $4)
if [ "$#" -ne 4 ]; then
echo "Please enter Names"
else
for i in 1 2 3 4 5
do
echo "Welcome $i times"
done
echo "The Name is: "
fi
I’m getting syntax error in shell script: Unexpected token fi. Please guide what I am doing wrong in the script.
You script works for me, on
GNU bash, version 4.2.39: