LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-10-2010, 12:09 PM   #1
Bamber
LQ Newbie
 
Registered: Aug 2003
Posts: 8

Rep: Reputation: 0
csh - break: Not in while/foreach


I've just imaged 6 machines with Centos 5.5 - 2.6.18-194.17.4.el5 SMP x86_64. Everything seems to work except when I try to run csh or tsch I get the message:

# csh
break: Not in while/foreach.

The only place I find this is in tcsh/tests/noexec.at in the source code for tcsh. Anyone have any idea why this might be happening or how I might diagnose this.

Other machines with the same version of tcsh (tcsh.x86_64 0:6.14-17.el5_5.2) are working just fine. I've tried earlier versions but this has the same result
 
Old 11-10-2010, 04:57 PM   #2
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,094
Blog Entries: 2

Rep: Reputation: 111Reputation: 111
look in your .cshrc .tcshrc files and see if you have a bogus break in a foreach, potentially if it's loading .profile (not sure if csh does that) you might be pulling in a bash init file like .bashrc
 
Old 11-11-2010, 10:27 AM   #3
Bamber
LQ Newbie
 
Registered: Aug 2003
Posts: 8

Original Poster
Rep: Reputation: 0
Solved

Thanks for the input, it pointed me in the right direction. The problem was with the openwin.csh script in /etc/profile.d. (file was dated 2004!)
I must have selected openwin when installing the original machine just in case someone ever wanted it. I'm not overly familiar with csh so I can't quite tell what is wrong here, maybe someone else can see?

File contents:
Code:
# OpenWindows initialization script (csh)
if ( $?OPENWINHOME ) then
         if ( $OPENWINHOME == "/usr/openwin" ) then
         break
         endif
endif
setenv OPENWINHOME /usr/openwin
setenv GUIDEHOME ${OPENWINHOME}/lib/guide
setenv HELPPATH ${OPENWINHOME}/lib/help
set owpath="${OPENWINHOME}/bin"
echo ${PATH} | grep -q ${owpath}
if ( $status == 0 ) then
  exit
endif
setenv PATH "${owpath}:${PATH}"
 
Old 11-11-2010, 11:00 AM   #4
makyo
Member
 
Registered: Aug 2006
Location: Saint Paul, MN, USA
Distribution: {Free,Open}BSD, CentOS, Debian, Fedora, Solaris, SuSE
Posts: 718

Rep: Reputation: 72
Hi.
Code:
       break   Causes execution to resume after the end of the nearest enclos-
               ing  foreach  or  while.  The remaining commands on the current
               line are executed.  Multi-level breaks  are  thus  possible  by
               writing them all on one line.

excerpt form man tcsh
For a system running:
Code:
Environment: LC_ALL = C, LANG = en_US.UTF-8
(Versions displayed with local utility "version")
OS, ker|rel, machine: Linux, 2.6.18-194.11.4.el5, i686
Distribution        : CentOS release 5.5 (Final)
tcsh 6.14.00
This system has no record of openwin in /etc/profile.d nor anyplace else, searching with locate openwin, but found:
Code:
$ locate tcsh
/bin/tcsh
( and many other hits)
With the repositories I have (default, to the best of my knowledge), yum finds nothing about openwin:
Code:
$ yum info '*openwin*'
Loaded plugins: priorities
addons                                                   |  951 B     00:00     
base                                                     | 2.1 kB     00:00     
extras                                                   | 2.1 kB     00:00     
updates                                                  | 1.9 kB     00:00     
Error: No matching Packages to list
My recollection about openwin is that it is associated with Solaris, not CentOS, but I haven't done any searching to verify that.

Regarding the error, perhaps tcsh is more particular about where break can be placed, namely, only in a while or foreach loop -- I could believe that csh might simply ignore it. If I find a real csh (say on Solaris) I'll try to remember to test that.

Best wishes ... cheers, makyo
 
Old 11-11-2010, 12:00 PM   #5
Bamber
LQ Newbie
 
Registered: Aug 2003
Posts: 8

Original Poster
Rep: Reputation: 0
Strange, openwin was indeed the windows manager for Solaris 10 for sure. The other possible culprit for inserting this file is the proprietary nvidia drivers. The first machine had :-

nvidia-x11-drv-256.44-1.el5.elrepo
kmod-nvidia-256.44-1.el5.elrepo

These seem to be no longer be maintained. So the other machines cloned from the first have:-

nvidia-graphics260.19.12-260.19.12-129.el5
nvidia-graphics-devel-260.19.12-52
nvidia-graphics260.19.12-kmdl-2.6.18-194.17.4.el5-260.19.12-129.el5
nvidia-graphics-devices-1.0-5.0.el5
nvidia-graphics260.19.12-devel-260.19.12-129.el5
nvidia-graphics260.19.12-libs-260.19.12-129.el5
nvidia-graphics-260.19.12-52
nvidia-graphics-helpers-0.0.29-32.1.el5

I'm just glad csh works now
 
  


Reply

Tags
csh, tcsh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
exit by foreach cicle shifter Programming 1 06-21-2010 02:13 PM
how to use foreach in bash shell minsi Linux - Newbie 9 03-26-2010 01:34 AM
How to use foreach on filenames with spaces? BrianK Linux - General 3 08-09-2005 12:15 PM
foreach loops chunky Linux - General 2 07-02-2004 11:49 AM
perl:foreach katana Programming 3 07-24-2001 01:05 AM


All times are GMT -5. The time now is 07:34 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration