Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 2006 09:04:12 +1000
From:      Malcolm Fitzgerald <mfitzgerald@pacific.net.au>
To:        freebsd-questions@FreeBSD. ORG <freebsd-questions@freebsd.org>
Subject:   Re: Shell scripting question [newby]
Message-ID:  <b8f376795b689fd1191afb907df5b43b@pacific.net.au>
In-Reply-To: <20060409153819.V96633@tribble.ilrt.bris.ac.uk>
References:  <b1b139752a28f74bc0811281a13932eb@pacific.net.au> <20060409153819.V96633@tribble.ilrt.bris.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

On 10/04/2006, at 12:39 AM, Jan Grant wrote:

> On Sun, 9 Apr 2006, Malcolm Fitzgerald wrote:
>
>> I'm trying to follow the instructions at
>> <http://www.daemonology.net/freebsd-upgrade-5.4-to-6.0/>;
>>
>> At point four it offers this shell script.
>>
>> cut -f 1 -d '$' /usr/local/freebsd-update/work/md5all | uniq |
>>         while read X; do
>>                 if [ -f $X ]; then echo $X; fi;
>>         done | sort > /root/base-old
>>
>> Running this from root shell in konsole (bash) I get "while: 
>> Expression
>> Syntax". The various hints and clues I get from the shell, the web 
>> and man
>> bash haven't helped me. Would someone provide the correct syntax for 
>> me?
>
> That syntax is correct for sh and bash; you're not running it, however.
> Double-check that after you su to root, you're really running bash. 
> That
> error is what csh will tell you.


Thanks Jan,

Your advice got me to step 7 where the need to pass a control structure 
to the loop stopped me again.

I got a bash shell and I write:

for dist in base dict doc games info manpages ports; do
         cat /mnt/6.0-RELEASE/${dist}/${dist}.?? > /usr/${dist}.tgz
done

I put it onto three lines by typing "\" at the end of each line to 
achieve the layout and I get the prompt ">". When I get to the end, ie, 
"done" I press Enter and get another prompt.

How can I get the multi-line command executed?

Malcolm




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b8f376795b689fd1191afb907df5b43b>