Re: some tcsh questions

2000-08-06 Thread kmself
On Fri, Aug 04, 2000 at 10:40:23PM +0200, Jonas Moberg wrote:
> I've (after many years of use..) been looking up what my shell
> actually can do for me to make my life easier. I've been going thru
> the features of tcsh (first shell I ever used, but I'm determined to
> go thru bash and zsh or ksh (when time permits that is..)).

Suggestion:

o Start with bash and zsh.  I'd suggest you'll generally find  that
  these are advanced shells which supercede virtually all the
  functionality of precursor shells, including the Bourne shell line
  (sh, korn, posix-compliant, bash, bash2) and csh line (csh, tcsh,
  zsh).  For userland, you're most likely going to find that bash
  and zsh are going to have features you really, really like.

You may also want to look at a few alternate shells, for special
purposes. 
  
o ash is a lightweight shell, useful on rescue disks (though
  last I checked, Tom's Root/Boot seemed to be running a bash-like
  shell).  As standard shells have bulked up, lightweight shells
  are finding a place for rescue or limited-storage situations.

o sash is a "secure" shell -- it contains built-ins for a whole mess
  of what are normally system commands.  It is also (usually)
  statically linked -- it doesn't require external libraries.  This
  makes it useful as a rescue shell or for exploring a system which
  is suspected of being compromised.

> So, of course, I got some questions for you all.. ;-) When I was
> reading the tcsh man-page I found some interesting examples on how to
> set the xterm title.

See the BashPromptHOWTO for equivalent under bash.

In my .bashrc

# Following sets prompt to [EMAIL PROTECTED] dir], and puts the full 
#   [EMAIL PROTECTED]:/full/path/spec in an xterm title bar.
function proml
{
case $TERM in
xterm*|rxvt|eterm|wterm)
local TITLEBAR='\[\033]0;[EMAIL PROTECTED]:\w\007\]'
;;
*)
local TITLEBAR=''
;;
esac

PS1="${TITLEBAR}\
[EMAIL PROTECTED]:\W]\
\$ "
PS2='> '
PS4='+ '
}

proml
unset proml
export PS1

-- 
Karsten M. Self  http://www.netcom.com/~kmself
 Evangelist, Opensales, Inc.http://www.opensales.org
  What part of "Gestalt" don't you understand?   Debian GNU/Linux rocks!
   http://gestalt-system.sourceforge.net/K5: http://www.kuro5hin.org
GPG fingerprint: F932 8B25 5FDD 2528 D595 DC61 3847 889F 55F2 B9B0


pgprm2vazSBDc.pgp
Description: PGP signature


Re: some tcsh questions

2000-08-06 Thread Jürgen A. Erhard
> "Jonas" == Jonas Moberg <[EMAIL PROTECTED]> writes:

>>  Do yourself a favor and try zsh first... even
>> before tcsh (in other words: get rid of that), but certainly before
>> bash.  Go with the package in potato, or better yet, with 3.1.9* in
>> woody.  I'd bet you will *not* regret it...  

Jonas> Done.. =) Now I'll just have to take myself time and try it
Jonas> out thourily..

Start with the best feature: completion.  There's a script,
/usr/share/zsh/functions/compinstall.  Source that
(". /usr/share/"), and, voila, a menu for configuring the
completion system.

Badass, I tell you... ;-)

>> Stupid question: you know that those ^ thingies are control
>> codes, right?  Now I don't know whether tcsh understand ^[ (two
>> ascii chars) to be ESC automagically or not...  make sure those
>> are one char (in Emacs or jed, type ctrl-q and then the char
>> (esc or ctrl-g).  vi?  I don't even have one one this system
>> ;-)

Jonas> I tried that and I still can't seem to get it to work with
Jonas> tcsh. Might be me doing something stupid thou. Haven't
Jonas> tried it in zsh yet.

Maybee it's tcsh... don't know, works for me, sorry.

Jonas> While I'm at it, I'll get another tcsh issue of my
Jonas> chest. Is there any possibility to get TAB to do the the
Jonas> tcsh list-glob function (lists global patterns) aswell as
Jonas> the commands-, dir-, var-, env-completion that it does by
Jonas> default?
>> 
>> Don't know what this means... I only know zsh's
>> completion system r0x. ;-))

Jonas> list-glob lists all matches to a global-pattern. If i type
Jonas> "ls ~/www/*.html" it'll give me a list of matches. I tried
Jonas> this in zsh actually and it expanded the pattern on the
Jonas> commandline for me when I pressed TAB, like the expand-glob
Jonas> in tcsh =). Not exactly what I wanted, but close
Jonas> enough.. There might even be a setting somewhere to change
Jonas> it, but I just haven´t got the strength to look it up in
Jonas> the zsh manpage just yet.. I've had enough of manpages for
Jonas> a while. ;)

Closer is glob_complete (setopt globcomplete).

But probably not exactly what you want... it expands the word in the
command line and steps through the completions via TAB.

The original *.html is gone, so pressing ENTER would jsut deal with
one.

Though, maybe that is what you want.  But probably not.  OTOH,
mentioning it on zsh-users might bring a surprise (the zsh folks are
always willing to make zsh even fancier ;-) (zsh-users is gated into
zsh-workers).

Bye, J

-- 
Jürgen A. Erhard  eMail: [EMAIL PROTECTED]  phone: (GERMANY) 0721 27326
  My WebHome: http://members.tripod.com/Juergen_Erhard
  "vi has two modes the one in which it beeps
  and the one in which it doesn't" -- Alan Cox


pgpeucuuif8zG.pgp
Description: PGP signature


Re: some tcsh questions

2000-08-06 Thread Jonas Moberg
>  Do yourself a favor and try zsh first... even
> before tcsh (in other words: get rid of that), but certainly before
 > bash.  Go with the package in potato, or better yet, with 3.1.9* in
> woody.  I'd bet you will *not* regret it...  

Done.. =) Now I'll just have to take myself time and try it out thourily..

>Jonas> Just for your info, I can't seem to get these other
>Jonas> xterm-titles using cwdcmd to work either. I'm not so good
>Jonas> that I understand what ^[]2; and ^G does.
>
> Stupid question: you know that those ^ thingies are control codes,
> right?  Now I don't know whether tcsh understand ^[ (two ascii chars)
> to be ESC automagically or not...  make sure those are one char (in
> Emacs or jed, type ctrl-q and then the char (esc or ctrl-g).  vi?  I
> don't even have one one this system ;-)

I tried that and I still can't seem to get it to work with tcsh. Might be me
doing something stupid thou. Haven't tried it in zsh yet.

>Jonas> While I'm at it, I'll get another tcsh issue of my
>Jonas> chest. Is there any possibility to get TAB to do the the
>Jonas> tcsh list-glob function (lists global patterns) aswell as
>Jonas> the commands-, dir-, var-, env-completion that it does by
>Jonas> default?
>
> Don't know what this means... I only know zsh's
> completion system r0x. ;-))

list-glob lists all matches to a global-pattern. If i type "ls ~/www/*.html"
it'll give me a list of matches. I tried this in zsh actually and it expanded
the pattern on the commandline for me when I pressed TAB, like the expand-glob 
in tcsh =). Not exactly what I wanted, but close enough.. There might even be a 
setting somewhere to change it, but I just haven´t got the strength to look it 
up in the zsh manpage just yet.. I've had enough of manpages for a while. ;)




Re: some tcsh questions

2000-08-05 Thread Jürgen A. Erhard
> "Jonas" == Jonas Moberg <[EMAIL PROTECTED]> writes:

Jonas> I've (after many years of use..) been looking up what my
Jonas> shell actually can do for me to make my life easier. I've
Jonas> been going thru the features of tcsh (first shell I ever
Jonas> used, but I'm determined to go thru bash and zsh or ksh
Jonas> (when time permits that is..)).

 Do yourself a favor and try zsh first... even
before tcsh (in other words: get rid of that), but certainly before
bash.  Go with the package in potato, or better yet, with 3.1.9* in
woody.  I'd bet you will *not* regret it...  

Jonas> This is something I've been looking for a long time, being
Jonas> able to print the current process in the xterm-title (be it
Jonas> "top" or "joe" or whatever). Not that this example works of
Jonas> course ;).. But why? Is it depending on the window-manager?

If you tell us what WM you use... but think about it, the title bar is
decoration, which is done by the WM (if you start without a valid WM,
you get borderless windows... not window title).  So it might well be.

Though I don't know of any WM that doesn't... at least both Window
Maker and Sawfish are confirmed to be able to.  (I ran WMaker and do
full GNOME now (Helix got me ;-))

Jonas> I've read the xterm-title mini-howto and it simply says
Jonas> it's "hard" to do it in any other shell than zsh (the
Jonas> author welcomes any suggestions).

Another reason for choosing zsh ;-)

Jonas> Just for your info, I can't seem to get these other
Jonas> xterm-titles using cwdcmd to work either. I'm not so good
Jonas> that I understand what ^[]2; and ^G does.

Stupid question: you know that those ^ thingies are control codes,
right?  Now I don't know whether tcsh understand ^[ (two ascii chars)
to be ESC automagically or not...  make sure those are one char (in
Emacs or jed, type ctrl-q and then the char (esc or ctrl-g).  vi?  I
don't even have one one this system ;-)

I have this construct in my zsh PROMPT: ]2;%M:%~

Note how ^[ and ^G are not two characters each, but one.  Works
perfectly... even when closing an ssh connection, the host got
restored.

[...]

Jonas> Of course, if you got any solutions or suggestions for bash
Jonas> or other shells feel free to share them.. ;)

I'm glad I did. ;-)  HTHS.

Jonas> While I'm at it, I'll get another tcsh issue of my
Jonas> chest. Is there any possibility to get TAB to do the the
Jonas> tcsh list-glob function (lists global patterns) aswell as
Jonas> the commands-, dir-, var-, env-completion that it does by
Jonas> default?

Don't know what this means... I only know zsh's
completion system r0x. ;-))

Jonas> Thanks!

What for? ;-)

Bye, J

-- 
Jürgen A. Erhard  eMail: [EMAIL PROTECTED]  phone: (GERMANY) 0721 27326
 MARS: http://members.tripod.com/Juergen_Erhard/mars_index.html
   "Outside of a dog, a man's best friend is a book;
   inside of a dog, it's very dark." --  Groucho Marx


pgpycPgW3orVH.pgp
Description: PGP signature