Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I don't seem to be able to make this work. I've switched to tc shell and made a .tcshrc file, which looks a bit like this:
################################################################
# .tcshrc
# User specific aliases and functions
alias rm 'rm -i'
alias cp 'cp -i'
alias mv 'mv -i'
# Source global definitions
if [ -f /etc/tcshrc ]; then
. /etc/tcshrc
endif
What's wrong with my if statement? Have I missed something out?
Also, I need to add these statements to the .tcshrc in order to get a program to run:
setenv LD_LIBRARY_PATH $HOME/EMAN/lib
set path = (. $HOME/EMAN/bin $HOME/bin /bin)
But when I add these to the .tcshrc nothing changes. What exactly am I doing wrong?
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
When you make changes to the .tcshrc file, you need to run the command
Code:
source ~/.tcshrc
to make the changes take effect in the current shell. You can also close the shell and open a new one. This hopefully will sort the environment variable problem.
I'm no pro here, but I think the problem is the ";" after the first line of the statement. Remove that and add "source" to the command.. Now it will look like:
alias rm 'rm -i'
alias cp 'cp -i'
alias mv 'mv -i'
# Source global definitions
if ( filetest -e file )
source /etc/tcshrc
endif
setenv LD_LIBRARY_PATH $HOME/EMAN/lib
set path = (. $HOME/EMAN/bin $HOME/bin /bin /etc)
################################################
And I'm back to the "if: expression syntax" error message. Some of you may have realised by now that I am rubbish at this kind of thing. All I really want to do is add the path and setenv lines at the bottom of my script so that i don't have to type them in every time I run the program. I feel I have to use tcsh 'cos that's what I'm on at university and I understand bash even less (if that's actually possible!). If anyone still feels they want to help me then that's very much appreciated, but I understand if you'd rather do something else!
The top one works. thanks very much. I'm sure I tried that earlier.
However, (perhaps I should have seen this one coming) because I have changed path and environment variables, I've now lost the use of my editor, commands like "less", and basically everything else that's useful. Sorry!
I get a "bad : modifier in $ ($)" message. I think that the export path statement there is bash syntax. I'll have a look at it. Thanks for helping though! Much appreciated!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.