i get following error.
how do i troubleshoot?
where is it coming from ?
[root@machine1 ~]# csh
set: Variable name must begin with a letter.
Please keep your Subject: line short ... the body of the post is where your
explanantion belongs.
It's rather inconceivable that you'd want to invoke [t]csh as the root user.
First determine what shell you're *really* invoking:
ls -l `which csh`
lrwxrwxrwx 1 root root 4 May 20 02:11 /bin/csh -> tcsh
Then "man tcsh" and carefully read the "Startup and shutdown" section to see
which files are processed
When the shell is initialized, it's looking for the resources specified
first in /etc/csh.{login,cshrc} and then in ~/.[t]cshrc, then ~/.login etc.
You should carefully examine those files (in the order stated in your [t]csh
man page) for the clearly-stated error of a varaible name not starting with
an alphabetic character.
sorry about long subject line
thank you for your reply
i found out that tcsh runs files under /etc. those files are csh.login
and csh.cshrc
i also runs some *.csh files under /etc/profile.d/ which runs from
inside script csh.cshrc.
how can i pinpoint which line exactly is throwing that error i see
when i try to run csh from command prompt ?
i ran almost all set commands from all scripts which i think run after
i run csh on command prompt and i did not get any error.
how i debug this? please help
>>> i get following error.
>>> how do i troubleshoot?
>>> where is it coming from ?
>>
>>> [root@machine1 ~]# csh
>>> set: Variable name must begin with a letter.
...
> how can i pinpoint which line exactly is throwing that error i see
> when i try to run csh from command prompt ?
csh -V
will pinpoint the error line quite clearly, but you'll then have to find in
which file it exists. grep makes that part easy too.
e.g.:
$ csh -V
...
setenv MAIL "/var/spool/mail/$USER"
limit coredumpsize 0
set 123test = "hey there"
set: Variable name must begin with a letter.
$
thank you so much everyone
i found the problem
Most likely your own .cshrc or .tcshrc (in root's home dir),
which is executed at the start of each (t)csh.
It just _could_ be a defective /etc/csh.cshrc script, but that one
often isn't even present at all, or you installed a package with
a settings script (in /etc/profile.d/<packagename>.csh) that has
a syntax error.
PS: a csh LOGIN shell executes /etc/csh.login, /etc/profile.d/*.csh,
/etc/csh.cshrc, the user's .login and .cshrc (or .tcshrc), in THAT
order, a NON-login shell, like you're executing, skips the .login
ones and possibly (depending on the distro) the /etc/profile.d ones
(they're called from either /etc/csh.login or /etc/csh.cshrc, the
shell doesn't auto-search for them.
I.E. in (open)SUSE:
foreach _s ( /etc/profile.d/*.csh )
if ( -r $_s && ! -k $_s ) then
source $_s
endif
end
is present in /etc/csh.login (and thus is only done for LOGIN
invocations of tcsh).
(the test is for "readable but NOT sticky", as to being able to
disable some of them, other distributions may use a -x (executable)
test, but they do NOT have to be executable as they're sourced).
Our CentOS servers also execute the profile.d csh scripts from
/etc/profile.d (but with different tests), I haven't got any real
RedHat systems here (nor any recent Fedora's).
--
******************************************************************
** Eef Hartman, Delft University of Technology, dept. SSC/ICT **
** e-mail: E.J.M....@tudelft.nl - phone: +31-15-27 82525 **
******************************************************************
> thank you so much everyone
> i found the problem
Of course the problem is using csh as root. Your manifestation of it is only
one of very many possible.