Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

when invoking csh command from bash prompt ( which is default ) i get error "set: Variable name must begin with a letter."

5,563 views
Skip to first unread message

jagdip

unread,
Jul 14, 2010, 12:33:19 PM7/14/10
to
hi,

i get following error.
how do i troubleshoot?
where is it coming from ?

[root@machine1 ~]# csh
set: Variable name must begin with a letter.

Greg Russell

unread,
Jul 14, 2010, 12:53:20 PM7/14/10
to
"jagdip" <jag...@gmail.com> wrote in message
news:fb87dab3-0c2f-4851...@t10g2000yqg.googlegroups.com...

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.


jagdip

unread,
Jul 14, 2010, 3:23:01 PM7/14/10
to

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

Greg Russell

unread,
Jul 14, 2010, 6:45:50 PM7/14/10
to
In news:665c858a-2290-4545...@w30g2000yqw.googlegroups.com,
jagdip <jag...@gmail.com> typed:

>>> 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.

$


jagdip

unread,
Jul 15, 2010, 9:31:55 AM7/15/10
to
On Jul 14, 6:45 pm, "Greg Russell" <gruss...@example.con> wrote:
> Innews:665c858a-2290-4545...@w30g2000yqw.googlegroups.com,

thank you so much everyone
i found the problem

Eef Hartman

unread,
Jul 16, 2010, 2:46:04 PM7/16/10
to
jagdip <jag...@gmail.com> wrote:
> [root@machine1 ~]# csh
> set: Variable name must begin with a letter.

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 **
******************************************************************

Greg Russell

unread,
Jul 19, 2010, 2:31:16 PM7/19/10
to
In news:4bcf615d-9bac-4af3...@j13g2000yqj.googlegroups.com,
jagdip <jag...@gmail.com> typed:

> 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.


jesus...@gmail.com

unread,
Nov 8, 2015, 1:52:47 AM11/8/15
to
What exactly is the problem and how you resolved it.
thanks in advance

prana...@gmail.com

unread,
Jun 19, 2018, 6:23:34 AM6/19/18
to
How did you removed it
0 new messages