Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: csh/tcsh

  1. #1

    Question csh/tcsh

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

  2. #2

    Default Re: csh/tcsh

    Quote Originally Posted by slmrcn View Post
    I logged to csh but none of commands work there.
    And how did you "log to csh"?

    If I run "csh" in Konsole, I can run those commands just fine:
    Code:
    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?

  3. #3
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,371
    Blog Entries
    3

    Default Re: csh/tcsh

    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:
    Code:
    'ls'
    (with the shown quotes). If that works, then your problem is a bad alias for "ls".
    openSUSE Leap 15.1; KDE Plasma 5;

  4. #4

    Exclamation Re: csh/tcsh

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

  5. #5
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,371
    Blog Entries
    3

    Default Re: csh/tcsh

    Try:
    Code:
    % echo $path
    % echo $PATH
    For those, I get:
    Code:
    % 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.
    openSUSE Leap 15.1; KDE Plasma 5;

  6. #6

    Default Re: csh/tcsh

    Hi,

    In this case which is useful because it is a builtin in (at least) tcsh.

    Code:
    which which
    Code:
    which ls
    "Unfortunately time is always against us" -- [Morpheus]

    .:https://github.com/Jetchisel:.

  7. #7
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,371
    Blog Entries
    3

    Default Re: csh/tcsh

    Quote Originally Posted by jetchisel View Post
    In this case which is useful because it is a builtin in (at least) tcsh.
    It has always been a builtin for traditional "csh" (from BSD unix). So is "echo", which I suggested using.
    openSUSE Leap 15.1; KDE Plasma 5;

  8. #8

    Default Re: csh/tcsh

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

  9. #9

    Default Re: csh/tcsh

    Quote Originally Posted by slmrcn View Post
    I think csh.cshrc.local file was the problem. Adding any program path to this file prevents accessing other paths.
    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:
    Code:
    set path = ($path /usr/local/bin)
    (taken from http://www.cyberciti.biz/faq/unix-li...le-in-c-shell/ and I tried it too, ls still works with that in /etc/csh.cshrc.local... )

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,884

    Default Re: csh/tcsh

    Quote Originally Posted by slmrcn View Post
    Adding any program path to this file prevents accessing other paths.
    .
    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).
    Henk van Velden

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •