Run hexdump on the script and post the results. The hexdump should look
*exactly* like this:
$ hexdump -xc test
0000000 2123 622f 6e69 622f 7361 0a68 6f66 2072
0000000 # ! / b i n / b a s h \n f o r
0000010 2069 6e69 6020 6573 2071 2031 3031 3b60
0000010 i i n ` s e q 1 1 0 ` ;
0000020 640a 0a6f 2020 2020 2020 2020 6365 6f68
0000020 \n d o \n e c h o
0000030 2420 0a69 6f64 656e 000a
0000030 $ i \n d o n e \n
0000039
Or e-mail me the script.
George
Clayton Stapleton wrote:
>
> My system is an Athlon 1600X CPU, 256MB of memory, with SuSE Linux 7.3
> mounted as a dual boot. The version of bash is 2.05-82. When I try some
> of the exercises in the Bash-Prog-Intro-HOWTO-1.html such as the "for",
> "while" and "until" loops thats as far as I have gotten so far I get the
> following from this "for" script when it is run:
>
> #!/bin/bash
> for i in `seq 1 10`;
> do
> echo $i
> done
>
> bash: syntax error near unexpected token `for'
>
> With the "while" and "until" scripts when they are run I get a ">" and it
> just sets there until I do a ctrl-c. The scripts are as follows:
>
> #!/bin/bash
> COUNTER=0
> while [ $COUNTER -lt 10 ]; do
> echo The counter is $COUNTER
> let COUNTER=COUNTER+1
> done
>
> #!/bin/bash
> COUNTER=20
> until [ $COUNTER -lt 10 ]; do
> echo COUNTER $COUNTER
> let COUNTER-=1
> done
>
> I am running these scripts in my home directory.
> Any help will be appriciated.
>
> Clay Stapleton
> Scottsdale, Arizona
>
> ________________________________________________
> See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail doesn't post to the list quickly and you use Netscape to write mail.
>
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss