Page 1 of 1

foreach

PostPosted: Apr 30th, '13, 23:05
by ofbodur
I entered the following command in a .sh file

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?

Re: foreach

PostPosted: May 2nd, '13, 06:20
by Per
foreach is a Tcl command and not bash if I'm not mistaken.