🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.shell
2 messages
2 total messages Started by Rick Eames Wed, 21 Nov 1990 17:30
C-Shell Question
#1808
Author: Rick Eames
Date: Wed, 21 Nov 1990 17:30
24 lines
804 bytes
I am having a problem with a shell script that really does nothing, but 
won't work anyway.

set x=1
set y=10

while ($x <=$y)
     echo This does nothing.
     @ x++
end


when I run this script, it tells me that it didn't expect an end of file, 
and get's the error one line greater than the actual number of lines in 
the file.

Any hints?

please respond to athos@apple.com


###########################
Athos
"Not Apple's Opinions....blah...blah....blah"
Re: C-Shell Question
#1864
Author: Tony J Yeates
Date: Thu, 29 Nov 1990 20:59
33 lines
1339 bytes
athos@apple.com (Rick Eames) writes:

>I am having a problem with a shell script that really does nothing, but 
>won't work anyway.

>set x=1
>set y=10

>while ($x <=$y)
>     echo This does nothing.
>     @ x++
>end


>when I run this script, it tells me that it didn't expect an end of file, 
>and get's the error one line greater than the actual number of lines in 
>the file.

Don't know why it fails, but it does  in csh & tcsh .... usually!
If you do:

	csh <script name>

it works! (You need to add a space between the >= and the $y tho')

The fix is to add the shell selection line at the start, on the Sun I work
on, my first line is "#!/bin/csh -f". Works fine! (Again don't know why -
is it a bug, or are we missing something here?!)

I think you should prob. use @ x = 1 and @ y = 10, rather than "set" -
although it works without them.

This seems like a black art sometimes!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads