running zsh command in tcsh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting running zsh command in tcsh
# 1  
Old 09-13-2010
running zsh command in tcsh

Hi all

is there a way to run zsh commands in a tcsh shell

thanks
# 2  
Old 09-13-2010
running a shell's command from another shell can be done using SHELLEXE -c 'cmd'.

so to execute a zsh command in tcsh use

Code:
zsh -c 'ls' # or whatever command.

Note: not tested..
# 3  
Old 09-13-2010
if i want to put something in my cshrc then
i have the following to add

Code:
watch=notme
export LOGCHECK="1"
export WATCHFMT="$(print '\e[31m')%n@%M $(print '\e[0m')%a"

i have tried this

Code:
zsh -c 'watch=notme'
zsh -c 'export LOGCHECK="1"'
zsh -c 'export WATCHFMT="$(print '\e[31m')%n@%M $(print '\e[0m')%a"'

but it does not like it

any ideas
thanks
# 4  
Old 09-13-2010
It is not possible to use "zsh" to set parameters in the "tcsh" environment.

BTW. Those parameters are "watch" parameters and they only apply to "zsh". Even if you managed to set them in .cshrc using "tcsh" commands they would have no effect.

Last edited by methyl; 09-13-2010 at 11:36 AM.. Reason: tcsh not csh
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Tcsh script - sed command for special characters

Hi, I am using sed command to replace following line in gz file- sed -n 's/""COS_12_TM_1" ( 1101110101001001010011110100000010110100010010000000100000000010XX010000000 )"/""COS_12_TM_1" ( 110111010100100101001111MM00000010110100010010000000100000000010XX010000000 )"/g' filename.gz $x=... (4 Replies)
Discussion started by: Preeti Chandra
4 Replies

2. Shell Programming and Scripting

Run bash command inside zsh script

Hi, I would like to run following code in bash inside a zsh script. (In this case is output unfortunately very different if you run it in zsh). I tried to put "bash" in front of the code but I obtained following error message "bash: do: No such file or directory " eve though I merged the whole... (7 Replies)
Discussion started by: kamcamonty
7 Replies

3. UNIX for Dummies Questions & Answers

Tcsh command for assigning output of awk to variable

Hi I have a text file with 2 values and I am trying to assign each value to a variable and then write those to text files. So if the textfile is data.txt with 2 values x and y I want to assign mean=x, and stdev=y and then write these out in text files alongwith the id ($id has already been... (6 Replies)
Discussion started by: violin
6 Replies

4. UNIX for Dummies Questions & Answers

Problem with xterm & tcsh & sourcing a script in a single command

Hi friends, I have a script that sets the env variable path based on different conditions. Now the new path variable setting should not done in the same terminal or same shell. Only a new terminal or new shell should have the new path env variable set. I am able to do this only as follows: >cd... (1 Reply)
Discussion started by: sowmya005
1 Replies

5. UNIX for Dummies Questions & Answers

command substitution with tcsh

I was trying to modify my .cshrc file so that the full path would always be displayed in my command prompt. After doing a search, I was able to accomplish this by adding these lines to my .cshrc file: alias setprompt 'set prompt="%/% "' setprompt alias cd 'chdir \!* &&... (1 Reply)
Discussion started by: Special_K
1 Replies

6. UNIX for Dummies Questions & Answers

at crontab tcsh setenv: command not found

i have written a script "master.shell" which is in the path: /a/homes.surrey.ac.uk/pgt_fs_002/bl00001/phd/griddata/shell/master.shell ==================================== #/usr/local/bin/tcsh setenv GLOBUS_LOCATION /grid/software/globus3 setenv PATH... (1 Reply)
Discussion started by: binbintriangel
1 Replies

7. UNIX for Dummies Questions & Answers

assigning (numeric) command output to var tcsh

Hello, I'm trying to assign a numeric value that is returned from one of my programs to a variable in tcsh. I want to do: @ r10 = './my_prog file 35' where ./my_prog file 35 returns a decimal value, but this doesn't work. How do I achieve the desired result? Janet (4 Replies)
Discussion started by: psran
4 Replies

8. Shell Programming and Scripting

Running a String as a command, zsh.

I have a shell script that is building a string that consists of the parts of a command that I want run at the end of the string. So it looks like this: $PART1=/path/to/command $PART2="-arg1" $PART3="-arg2" and so on. At the end of the command is a list of files I get from a loop and... (2 Replies)
Discussion started by: drnkhmlck
2 Replies

9. Shell Programming and Scripting

equivalent of ptree command in zsh

ptree command is not working in zsh. Could anyone let me know the equivalent of ptree command in zsh. (3 Replies)
Discussion started by: dhams
3 Replies

10. UNIX for Advanced & Expert Users

tcsh read command ......?

i have just started to use the tcsh shell as a sort of personal challenge since I see so many users using other shells than just bash... I have written a spcript that is quite lengthy but it is in bash shell and gives an error message in tcsh shell so I cut the script in half and basically... (4 Replies)
Discussion started by: moxxx68
4 Replies
Login or Register to Ask a Question