Using zsh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Using zsh
# 1  
Old 09-27-2010
Using zsh

Hi all

i am forced to use tcsh at work but i want to use zsh, so i have added this to my .cshrc

Code:
if (! $?STARTTCSH) then
    if ("$tty" != "" && -x /bin/zsh) exec /bin/zsh
    exit
endif

but this now stopped me going back to tcsh if i need to, is there a way to do this, i would normally just typr tcsh in a shell and that would let me but with the above coding i cannot

tbanks
# 2  
Old 09-27-2010
Why not just login and type zsh?

Does not seem like much trouble to me.
# 3  
Old 09-27-2010
because i use a shell the whole time so i want it always run zsh ( and i open and close a lot of shells) but if i need to i can revert back to tcsh
# 4  
Old 09-27-2010
Export an environment variable so you can check if you want to skip that programming. Have your code check for it.

Code:
export NOZSH=1
exec /bin/tcsh

# 5  
Old 09-27-2010
Hi.

exec tcsh would surely run the .cshrc again and invoke zsh?

If you removed the exec from your .cshrc file, then you can get back using to tcsh by pressing ˆD or typing exit from your zsh shell.

edit: Saw corona688's update, which is a work-around.
# 6  
Old 09-27-2010
ah you see i want to be able to switch betwee the but zsh to be my default one
# 7  
Old 09-27-2010
I can't imagine why anyone would <<force>> you to use a specific shell - especially that one!

They obviously don't "force" you too much if you can run zsh in the first place.

You can't change the default with chsh?

If nothing else, there's Neo's suggestion. Just type zsh when you want to use it... Put an alias Z in your .cshrc if that make it a little easier for you Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can I do this without eval? (zsh)

I have in one shell variable, op, a string which represents a "test operator" in a ] construct, for instance -d or -n or -s, an in another shell variable, arg, some arbitrary string. What I want to achieve, is basically this: #This is INCORRECT code. I just want to get you the idea, what I'm... (7 Replies)
Discussion started by: rovf
7 Replies

2. UNIX for Dummies Questions & Answers

ZSH Colors on AIX7

I'd put together a zshrc for use on Linux & AIX 5/6 at another shop that worked fine, but when I tried to put it on here it messes up the colors for some reason I can't understand. I used Phil's ZSH prompt for starters, and everything worked before, and still does on Linux, but isn't working on... (0 Replies)
Discussion started by: Vryali
0 Replies

3. Shell Programming and Scripting

zsh and host completion

Hi there is there a way i can add to my .zshrc so that when i type rsh <tab> it takes the name for a list of hosts i know it looks in .ssh/know_hosts but i want it for rsh and for a list that i supply thanks A (4 Replies)
Discussion started by: ab52
4 Replies

4. UNIX for Dummies Questions & Answers

Default editor in zsh

Guys, Can somebody help in setting vi as the default editor in zsh shell. I know that in ksh and bourne we can achieve the setting through .profile file. I want to replicate the behavior of ksh in zsh where on command prompt when one presses escape the screen acts as a vi. And one can use all... (1 Reply)
Discussion started by: yabhi_22
1 Replies

5. Shell Programming and Scripting

how to find the value of a variable in zsh?

I have a zsh script written by someone else, I am trying to modify it to work on slightly different data -problem is I know nothing about shell scripting. I am trying to muddle through this myself since I need to learn but can someone tell me how to debug a script? ie. I want to display the value... (6 Replies)
Discussion started by: cmp260
6 Replies

6. UNIX for Dummies Questions & Answers

Using wildcards in variables in zsh

Probably a stupid question... how do I use a wildcard in a variable in zsh? If I do: var=* echo $var in bash, it will print all files/directories in the current directory. If I do it in zsh, it will only output an asterisk without the wildcard functionality. Thanks in advance! (1 Reply)
Discussion started by: RainbowLAr
1 Replies

7. UNIX for Dummies Questions & Answers

question about zsh

hi, In bash, $ bind -P | grep yank-last yank-last-arg can be found on "\M-.", "\M-_". this allows me to press ALT key and the period (.) to yank the last argument of the previous command line into the current command line. How can I get the same behavior in zsh ? Thanks ... (0 Replies)
Discussion started by: Andrewkl
0 Replies

8. UNIX for Dummies Questions & Answers

Z-shell (zsh)

Z-shell (zsh) anyone use it and how do ya like it? (1 Reply)
Discussion started by: Bodhi
1 Replies

9. Shell Programming and Scripting

tutorials about zsh

hi there I'm looking for tutorials about zsh (beginners to experts) can you give me addresses please? thx a lot (3 Replies)
Discussion started by: SpY974
3 Replies
Login or Register to Ask a Question