LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-28-2004, 05:49 PM   #1
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 240

Rep: Reputation: 31
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!
 
Old 06-28-2004, 06:25 PM   #2
aluchko
Member
 
Registered: Mar 2004
Location: Edmonton, AB, Canada
Distribution: Fedora
Posts: 37

Rep: Reputation: 15
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
 
Old 06-28-2004, 08:32 PM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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
 
Old 06-28-2004, 09:04 PM   #4
aluchko
Member
 
Registered: Mar 2004
Location: Edmonton, AB, Canada
Distribution: Fedora
Posts: 37

Rep: Reputation: 15
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.
 
Old 06-28-2004, 09:22 PM   #5
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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
 
Old 06-28-2004, 09:43 PM   #6
aluchko
Member
 
Registered: Mar 2004
Location: Edmonton, AB, Canada
Distribution: Fedora
Posts: 37

Rep: Reputation: 15
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).
 
Old 06-28-2004, 11:25 PM   #7
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 240

Original Poster
Rep: Reputation: 31
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.
 
Old 06-28-2004, 11:43 PM   #8
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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
 
Old 06-29-2004, 12:26 AM   #9
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 240

Original Poster
Rep: Reputation: 31
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.
 
Old 01-17-2006, 11:33 AM   #10
munichtexan
Member
 
Registered: Oct 2005
Posts: 74

Rep: Reputation: 15
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:2aemon:/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
 
Old 01-17-2006, 11:50 AM   #11
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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).
 
Old 01-17-2006, 12:39 PM   #12
munichtexan
Member
 
Registered: Oct 2005
Posts: 74

Rep: Reputation: 15
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
 
Old 01-17-2006, 03:53 PM   #13
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
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.

Last edited by frob23; 01-17-2006 at 03:55 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I use tcsh and I have bash ?????? grizos Linux - General 2 11-21-2005 09:50 PM
I've lost my tcsh! ultimo_boulevard Programming 4 09-28-2005 08:35 AM
tcsh scripting mugsy Linux - General 12 08-06-2003 12:34 PM
tcsh problems ezrollers Linux - Software 3 06-03-2003 08:41 AM
tcsh hhegab Linux - Newbie 1 07-30-2002 05:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration