bash Scripts

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Clayton Stapleton
Date:  
Subject: bash Scripts
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