LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-22-2003, 12:37 PM   #1
m15a4
Member
 
Registered: Sep 2003
Distribution: SuSE 10
Posts: 55

Rep: Reputation: 15
Alias commands in tcsh (Suse 9.0)


Reading the tcsh setup file, I saw that '/etc/csh.cshrc.local' is sourced every time the tcsh shell is launched. Since that file did not exist, I created it and started dumping in alias's.

The 'csh.cshrc.local' file now contains the following;

# alias stuff
alias h history
alias hist history
alias cls clear
alias p 'ping \!*'
alias tr 'traceroute \!*'
# end of file

When I open a tcsh shell as a user these alias's work (well traceroute doesn't because for some reason as a user I can't run the traceroute command but that's another thread ) Now from that shell, I become root ( 'su' / 'password' ) the alias's fail. Why are they failing as 'root' when they work as 'user', and more importantly, how do I make them available to both root and user?

Thanks much!

p.s. this info may help ...

/home/blah> which tcsh
/usr/bin/tcsh
/home/blah> su
Password: ************************
suse:/home/blah # which tcsh
/bin/tcsh

and as stated above, the file that contains the alias's is...
'/etc/csh.cshrc.local'
So it looks like user and root are using 2 different tcsh's?

Last edited by m15a4; 11-22-2003 at 12:41 PM.
 
Old 11-22-2003, 12:46 PM   #2
BSlack
Member
 
Registered: Nov 2003
Location: Italy: 44° 42' N - 12° 11' E
Distribution: Slackware, what else?!!
Posts: 63

Rep: Reputation: 15
Try "su -"
the hyphen is part of the command.
 
Old 11-22-2003, 01:19 PM   #3
m15a4
Member
 
Registered: Sep 2003
Distribution: SuSE 10
Posts: 55

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by BSlack
Try "su -"
the hyphen is part of the command.
I did and no change.
 
Old 11-22-2003, 07:48 PM   #4
m15a4
Member
 
Registered: Sep 2003
Distribution: SuSE 10
Posts: 55

Original Poster
Rep: Reputation: 15
Looks like when i change to root, it also changes to bash rather than staying in tcsh. How do i stay in tcsh? That looks like the cause.
 
Old 11-24-2003, 03:25 AM   #5
BSlack
Member
 
Registered: Nov 2003
Location: Italy: 44° 42' N - 12° 11' E
Distribution: Slackware, what else?!!
Posts: 63

Rep: Reputation: 15
OK!
It's likely that root account have bash as default shell (this is the default for every account under Linux).
If you want to change the shell log in as root and use chsh command (see the manual page, man chsh ).
It ask you the password and the shell you want.
Type the full path to the shell, i.e. /bin/tcsh and be CAREFUL that the shell you set exist and is in that directory!!!
Otherwise when you'll log in, you'll have no control on the system and this is a very very bad thing.

______________________________________________________________
Enjoy the Slackware experience
 
Old 11-26-2003, 03:46 PM   #6
m15a4
Member
 
Registered: Sep 2003
Distribution: SuSE 10
Posts: 55

Original Poster
Rep: Reputation: 15
Thanks for the help folks, got it working now
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Alias question (2 commands for one alias) gflores Linux - Newbie 3 01-21-2006 12:40 AM
Shell scripts in tcsh not working on Suse 9.1 rtflynn Linux - Newbie 4 09-02-2004 07:56 PM
bash equivalence of tcsh "alias em "emacs \!:1 &""? rgiggs Slackware 3 07-29-2004 02:07 AM
RH9, alias and tcsh shell jeguilloal Red Hat 1 11-26-2003 01:42 PM
alias and export commands in modules.comf liguorir Linux - Software 1 06-26-2003 07:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:48 PM.

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