DaemonForums  

Go Back   DaemonForums > Miscellaneous > General software and network

General software and network General OS-independent software and network questions, X11, MTA, routing, etc.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 9th July 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default TCSH: 'set promptchars' not effecting su like it should

Hello,

I set up my TCSH configuration in NetBSD to make use of the promptchars feature, so that I would have % as the user prompt and # as the su prompt. If I don't set promptchars="%#", then the user prompt is > and the su prompt is # , but if I do then both are % . I have tried multiple combinations of commands, but to no avail. Here is my .cshrc, which I just modified from the default -

Code:
#	$NetBSD: dot.cshrc,v 1.3 2003/04/24 01:02:26 perry Exp $
#
# This is the default .cshrc file.
# Users are expected to edit it to meet their own needs.
#
# The commands in this file are executed each time a new csh shell
# is started.
#
# See csh(1) for details.
#

alias h		history 25
alias j		jobs -l
alias la	ls -a
alias lf	ls -FA
alias ll	ls -lA
alias su	su -m
alias date  "date '+%A %B%e, %Y - %l:%M:%S %p'"
alias poweroff  shutdown -p now
alias reboot    shutdown -r now

setenv	EDITOR	vi
setenv	VISUAL	${EDITOR}
setenv	EXINIT	'set autoindent'
setenv	PAGER	more
setenv  TERM    wsvt25

set path = (~/bin /bin /sbin /usr/{bin,sbin,X11R6/bin,pkg/{,s}bin,games} \
	    /usr/local/{,s}bin)

if ($?prompt) then
	# An interactive shell -- set some stuff up
	set filec
	set history = 1000
	set ignoreeof
	set mail = (/var/mail/$USER)
	set mch = `hostname -s`
        set promptchars="%#"
	set prompt = '%# '
	set autolist=ambiguous
endif
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
  #2   (View Single Post)  
Old 9th July 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,075
Thanked 198 Times in 156 Posts
Default

hmm, it works fine for me on FreeBSD, from my cshrc:

Code:
set prompt = "[%~]%# "  # Show current dir.
set promptchars="%#"    # Use % for normal user and # for super
The only difference I see it that I use double quotes (") for prompt and you use single quotes (').

Which version of tcsh are you using (tcsh --version)?

Also, why is "if ($?prompt) then" there? What is this supposed to do? Try removing it.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #3   (View Single Post)  
Old 9th July 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default

Hello,

Quote:
Originally Posted by Carpetsmoker View Post
The only difference I see it that I use double quotes (") for prompt and you use single quotes (').
That might have been it, though I thought I remembered using double quotes before.


Quote:
Originally Posted by Carpetsmoker View Post
Which version of tcsh are you using (tcsh --version)?
What comes with pkgsrc - 6.15.00nb2

Quote:
Originally Posted by Carpetsmoker View Post
Also, why is "if ($?prompt) then" there? What is this supposed to do? Try removing it.
It's there because that is what comes with the default .cshrc in NetBSD - and I only modified it. This isn't my final .cshrc, but it will suffice until I have time to construct one tailor-made to my unique needs and idiosyncricies.


Thanks for the quick help.
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
  #4   (View Single Post)  
Old 9th July 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,075
Thanked 198 Times in 156 Posts
Default

So it works after replacing the quotes?
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #5   (View Single Post)  
Old 9th July 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default

Hello,

Yes, it's working now.
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
History not saved in tcsh RandomSF FreeBSD General 8 9th December 2008 11:59 PM
TCSH - getting to start of line maxrussell FreeBSD General 3 4th July 2008 11:55 AM
Quick, simple tcsh tips for beginners anomie Guides 6 5th May 2008 08:07 PM


All times are GMT. The time now is 02:27 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick