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
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
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
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
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
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
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
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
Quick, simple tcsh tips for beginners anomie Guides 9 6th November 2014 03:55 PM
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


All times are GMT. The time now is 10:17 AM.


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