foreach

I entered the following command in a .sh file
after executing it, It gave me the error below:
./neww.sh: line 2: syntax error near unexpected token `('
./neww.sh: line 2: `foreach num ($*)'
I don't know where the problem is.. Can you help me guys?
- Code: Select all
#!/bin/bash
foreach num ($*)
repeat $num echo -n "."
echo ""
end
after executing it, It gave me the error below:
./neww.sh: line 2: syntax error near unexpected token `('
./neww.sh: line 2: `foreach num ($*)'
I don't know where the problem is.. Can you help me guys?