LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   setting up tcsh ... (https://www.linuxquestions.org/questions/linux-newbie-8/setting-up-tcsh-198834/)

JohnLocke 06-28-2004 05:49 PM

setting up tcsh ...
 
Hi there, I'm the worst kind of newbie on this forum, one who's used unix for a while but never from an admin level. Linux is just familiar enough to be dangerous.

I want to set up tcsh as my main shell, since I'm pretty familiar with it from work, but I'd rather not screw anything up for any of the other users while I'm at it (they're comfortable with bash). Can I do something as simple as rm .bash* from my home directory and replace it with a .cshrc file? Is there a profile file somewhere that sets which shell each user starts up in?

Thanks for the help!

aluchko 06-28-2004 06:25 PM

Don't delete any of your .bashrc files or anything. The command to use is chsh, specifically chsh -s /bin/tcsh (while logged in as the user you want to switch the shell for, ie yourself), I gave it a try myself and it didn't work but I suspect that's largely because my system is on the fritz but I recall trying it on other systems and it should work fine for you.

Alternatly you could add the line "tcsh" to your .bashrc but that would leave you with a tcsh running on top of a bash terminal and be really ugly :)

Dark_Helmet 06-28-2004 08:32 PM

Essentially, the chsh command modifies the /etc/passwd file. If you want, you can open up the file directly and modify it yourself. Find your username, and the very last field on the line specifies your login shell. Change it to wherever tcsh is installed. Chances are good it's /bin/tcsh like aluchko mentioned. Assuming you were the one that installed it, you'll probably know for sure.

If not, which tcsh will tell you :)

aluchko 06-28-2004 09:04 PM

Yeah I ran across the /etc/passwd thing too, the reason I didn't recommend it is because /etc/passwd is only an option if you're root, which I suspect JohnLocke is but I figgured that the chsh is better practice for the times he wants to change and doesn't have root.

Dark_Helmet 06-28-2004 09:22 PM

Oh, I wasn't suggesting editing /etc/passwd was better, easier, or more convenient by any means.

I just wanted to point out what exactly chsh was modifying a "profile file somewhere that sets which shell each user starts up in". As a beginning admin, I thought he'd find that info useful, and that he has the ability to go and make the changes manually if need be. There's no better way to learn than to get your hands dirty. Unfortunately, there's also no better way to screw something up either :)

aluchko 06-28-2004 09:43 PM

Yeah, playing with files is a fun way to screw things up (sigh my poor system:), the /etc/passwd thing was useful info I just didn't want him to get the wrong idea and think the /etc/passwd was the proper or more savvy way to go when at all possible I like to hang away from manually changing files, especially if I'm not 100% on what I'm doing. That being said I'm about to go mucking about in my /etc/X11/XF86Config to try and get the other buttons on my trackball doing something usefull (don't really need backup left and middle clicks).

JohnLocke 06-28-2004 11:25 PM

Wow, thanks!
 
You guys really had a ball with this one, eh?

I had thought of adding tcsh to the .bashrc as a temporary solution, but as you say, I hate excess usage :).

So I ran the command and double checked in the /etc/passwd file (yes, thanks for mentioning that, I always like to know multiple ways around things ... in case one doesn't work here or there). Looks like I'm up and running.

/Now/ can I get rid of all the .bash* stuff in my home directory (the only thing useful I had in there was a modification to my path, which I've already put into a .cshrc file)? Changing to .tcsh didn't create any .cshrc file or (what's it for .tcsh as an alternate to .cshrc, .cshrc.tcsh? I forget). I made one myself, but is this correct? As always, don't want to go off half-cocked. Fully cocked or nothing.

Dark_Helmet 06-28-2004 11:43 PM

From an administrator perspective, I would not delete the .bash* files in your home directory. The simple reason being this: if a user complains about a command doing something wrong, their environment is hosed, or whatever, it's good to have a copy of your own bash configuration files should you need to "jump over" if only temporarily. However, you could get rid of them if you like; it won't hurt you to delete them now that you're using tcsh.

As for the tcsh configuration files, you can read up about them in the tcsh man page. Here are the highlights though:
/etc/csh.cshrc -> global config
~/.tcshrc -> personal config; read after /etc/csh.cshrc

JohnLocke 06-29-2004 12:26 AM

Got it.
 
Not a bad idea. I should probably work on developing good admin habits like backing things up before I do something stupid :). I just like to have a clean slate to work with, including in my home directory. I'll tar them up and put them in a backup location.

Thanks for all the help! I think we've got this one licked.

munichtexan 01-17-2006 11:33 AM

Hi, I am a newbie at this and have Suse 10.0 installed on an Athlon 64. I was doing an install of a software package that would not work because the company I got it from typically uses tcsh. I was doing a vi on my .cshrc file as follows to set path and set up license key:

more .cshrc

set path = $path ~/ssoft/bin
setenv SS_LICENSE_FILE psida.key

And I get an error back about setenv

I modifed my /etc/passwd file (on the company's recommendation). The last line only changed it to /bin/tcsh but I am still getting the same error. Can any one out there educate me? thanks


root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/bin/bash
daemon:x:2:2:Daemon:/sbin:/bin/bash
lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash
mail:x:8:12:Mailer daemon:/var/spool/clientmqueue:/bin/false
news:x:9:13:News system:/etc/news:/bin/bash
uucp:x:10:14:Unix-to-Unix CoPy system:/etc/uucp:/bin/bash
games:x:12:100:Games account:/var/games:/bin/bash
man:x:13:62:Manual pages viewer:/var/cache/man:/bin/bash
at:x:25:25:Batch jobs daemon:/var/spool/atjobs:/bin/bash
wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false
ftp:x:40:49:FTP account:/srv/ftp:/bin/bash
postfix:x:51:51:Postfix Daemon:/var/spool/postfix:/bin/false
sshd:x:71:65:SSH daemon:/var/lib/sshd:/bin/false
ntp:x:74:65534:NTP daemon:/var/lib/ntp:/bin/false
mdnsd:x:78:65534:mDNSResponder runtime user:/var/lib/mdnsd:/bin/false
messagebus:x:100:101:User for D-BUS:/var/run/dbus:/bin/false
haldaemon:x:101:102:User for haldaemon:/var/run/hal:/bin/false
nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash
jnistler:x:1000:100:John Nistler:/home/jnistler:/bin/tcsh


Best regards,
MunichTexan

Dark_Helmet 01-17-2006 11:50 AM

Changing the line in /etc/passwd will only have effect once you log out (completely) and log back in. All that change does is tell the system to start your user in the tcsh shell automatically when logging in.

Now, to be sure that change is correct, verify that tcsh is in that location. You can do ls -l /bin and look for tcsh. If it's there, great. If not, then tcsh was installed somewhere else on your system, you'll need to locate it, and update that same line in /etc/passwd to reference the proper location.

If you want a quick n' dirty way to test your file, you can launch a tcsh shell from inside a bash shell. At a bash prompt, just type tcsh and you'll be put in a tcsh shell. I don't recall if it sources all the ~/.cshrc or ~/.tcshrc files automatically, but you can do that manually from the command line to test them out (e.g. source ~/.cshrc).

munichtexan 01-17-2006 12:39 PM

Thanks for the input. I had attempted typing in tcsh and recieved this return. I am not sure if it is an error, but it appears to be related to my /etc/passwd file.(???)

set: Variable name must begin with a letter.

As suggested, I did a ls -l /bin and tcsh is there.

Thanks,
MunichTexan

frob23 01-17-2006 03:53 PM

Try
Code:

setenv path "($path ~/ssoft/bin)"
This is using setenv... which is not the standard way of doing it in tsch. The standard way would be:

Code:

set path = ($path ~/ssoft/bin)
You'll note that the "'s, ()'s, and the = play an important part in the syntax here (although an admittedly odd one). Fix your path line and everything should be fine.

I recommend the latter unless they specifically say the path should be done with setenv instead of set. In which case just use the format above.


All times are GMT -5. The time now is 08:45 AM.