Hi all!
I am using opensuse 13.1. My default shell is bash but I need to run some scripts on csh. I logged to csh but none of commands work there. For example typing
>ls
gives
ls: Command not found.
Can anyone help me to run commands on csh or tcsh?
Thanks in advance…
And how did you “log to csh”?
If I run “csh” in Konsole, I can run those commands just fine:
wolfi@amiga:~> csh/home/wolfi% ls
...long list of files and directories...
/home/wolfi% cd /srv/
/srv% ls
ftp svn tftpboot www
/srv%
I am running 13.2, but that shouldn’t matter I suppose.
But I notice that my csh prompt shows the current directory followed by ‘%’, whereas yours seems to display only ‘>’.
Is that correct?
I suppose you would be missing some startup scripts then.
So it might also be interesting how you installed csh… Or are you just using the one that is installed by default?
I’m using “csh” (really “tcsh”) as my default shell. I am not seeing the problem that you mention. (I do comment out a few lines in “/etc/csh.cshrc”).
You could try:
'ls'
(with the shown quotes). If that works, then your problem is a bad alias for “ls”.
Thanks for replies.
I am logging in with both csh and tcsh. But none of commands work.
for csh;
slmrcn@lab-2:~> csh
/home/slmrcn% ls
ls: Command not found.
/home/slmrcn% exit
exit
and for tcsh;
*slmrcn@lab-2:~> tcsh
/home/slmrcn> ls
ls: Command not found.
/home/slmrcn>
*And also other commands do not work not only ls command.
Best regards…
Try:
% echo $path
% echo $PATH
For those, I get:
% echo $path
/home/rickert/bin /usr/local/bin /usr/bin /bin /usr/X11R6/bin /usr/bin/X11 /usr/games
% echo $PATH
/home/rickert/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/bin/X11:/usr/games
The first component is my own “$HOME/bin” directory.
Your path might be messed up.
Hi,
In this case which is useful because it is a builtin in (at least) tcsh.
which which
which ls
It has always been a builtin for traditional “csh” (from BSD unix). So is “echo”, which I suggested using.
I think csh.cshrc.local file was the problem. Adding any program path to this file prevents accessing other paths.
How can I solve it? I used old opensuse versions but I did not encounter such a problem.
Thank in advance…
Maybe you are not adding to the path but overriding it?
Could you post the corresponding lines in csh.cshrc.local please? Or maybe even the whole file.
Something like this should work to add directories to the path:
set path = ($path /usr/local/bin)
(taken from http://www.cyberciti.biz/faq/unix-linux-set-path-variable-in-c-shell/ and I tried it too, ls still works with that in /etc/csh.cshrc.local… )
Only telling what you think you did does not help us to check if what you did is correct or not. You should show us exactly what you did (copy/paste of computer text/commands/output).
I think that’s your own file. I don’t have that file on my system, and the “.local” suggests that it is intended as a local addition.
When I want to change the path in a script or in $HOME/.cshrc, I typically use something like:
setenv PATH /new/component:$PATH
which prepends the new part to the existing path.