tcsh

How do I use RVM with tcsh?

邮差的信 提交于 2019-12-11 06:57:37
问题 I would like to use RVM with tcsh; how do I do this? As far as I can see, there are no "official" instructions for this. I followed the instructions on "Using RVM with tcsh", but this didn't work for me; in particular, I don't have access to the Ruby binaries ruby , bundle , irb , rspec , etc. 回答1: This worked well for me on OS X Yosemite 10.10.2, though it adds about a 5-second delay to opening a Terminal window each time due to the RVM initialization. Create this file: https://gist.github

Whats wrong with this C shell script?

前提是你 提交于 2019-12-11 03:37:41
问题 I am trying to write a C shell equivalent script for the bash script mentioned here. This is what I have : #! /bin/tcsh set now=`date +%Y%m%d%H%M.%S` if (( ! -f "./cache" ) || (-n "`find ./monme -newer ./cache`" )) then touch cache -t "$now" echo "new files added" | mail -s "new build" myemail@myserver.com endif and this is the error I get $ ./scr if: Badly formed number. $ This page mentions that "Numbers in the C-shell must be integers", so I tried set now=`date +%Y%m%d%H%M` but I get the

Cannot set tcsh exit status using a variable

你说的曾经没有我的故事 提交于 2019-12-11 02:12:46
问题 I usually use bash, but in this case I must use tcsh. To my surprise, I cannot use a variable containing the exit status as the argument to exit : [bash] tcsh [tcsh] set status=2 [tcsh] echo $status 2 [tcsh] exit $status exit [bash] echo $? 0 A literal argument to exit does work as expected: [bash] tcsh [tcsh] exit 2 exit [bash] echo $? 2 What on earth is going on here? 回答1: $status is a built-in C shell variable containing the exit status of the previous command. Try echoing $status twice

tcsh script if statement

点点圈 提交于 2019-12-10 23:53:47
问题 I need to loop through a bunch of different scenarios (variable scen), but can't figure out how to use the if statements in the tcsh shell script. Getting the error "if: Expression Syntax" Can someone please tell me what I have wrong? Simplified code follows! Thanks! #!/bin/tcsh -f # set val = 0 foreach scen ( a b ) echo $scen if ($scen==a) then echo $scen else echo $val endif end 回答1: Solution to your problem Apparently you need spaces around the equality comparison == . This works: #!/bin

Received “/: Event not found.” when using PyCharm remote dubugger

我的未来我决定 提交于 2019-12-10 23:27:10
问题 When I use PyCharm with remote debug through ssh to a tcsh shell server , many times its stops working, and displays "/: Event not found" More specifically, I encounter the following in pycharm debug console. ssh://username@hostserver:22/path/to/bin/python -u /path/to/.pycharm_helpers/pydev/pydevd.py --cmd-line --multiproc --qt-support=auto --client '0.0.0.0' --port 40426 --file /path/to/python/file/main.py /: Event not found. Is the problem owing to history substitution in tcsh shell?

How to dereference a variable in CSH

一曲冷凌霜 提交于 2019-12-10 23:03:17
问题 I have a variable $var that has values as another variable $env . $env has some value . how can I use $var to print the value of $env. > set xyz = 'abc' set env = 'xyz' set v = '$' set var = "$v""$env" > > echo $var o/p: $xyz now I want to print the value the of $ xyz using $var 回答1: Use eval , like this: set xyz='abc' set var='xyz' eval echo \$$var This is more commonly known as an indirect reference . Here is an example script: set var = 'xyz' set xyz = 'abc' if ( $?var ) then echo '$var is

The counterpart of python-shell's underscore variable in tcsh?

大城市里の小女人 提交于 2019-12-10 22:26:55
问题 Is there any way to make tcsh keep the output of the last command in a special variable? I know I can capture the output using backticks, but if I don't use backticks in the first place, it's not captured anywhere. (anyone who likes the underscore variable in the python shell knows what I'm talking about) E.g. % ls | head -2 % echo $_OUT_ -> myfile1 myfile2 回答1: This page lists the special variables of tcsh and does not specify that there is a special variable for what you are looking for.

Aliasing find directory in Unix

拜拜、爱过 提交于 2019-12-10 20:23:38
问题 I tried something like: alias fdi 'find . -type d -iname "*\!^*"' but this only looks for exact names passed as argument. fdi abc will only output: ./d/abc not this: ./d/greabcyup I am not just looking for exact name. It should also show ./d/greabcyup Update: I did echo $0 tcsh 回答1: Is this c-shell or tcsh? I dbl-checked with orielly lunix in a nutshell , !^ is meant to be the first word in the current command line, so I don't think it is doing what you want. You can dbl check that theory for

echo nested quotation marks in tcsh

时光怂恿深爱的人放手 提交于 2019-12-10 15:59:39
问题 I have a tcsh script that generates a text file. One of the lines in the text file is: bla bla bla 'foo foo foo "bar bar bar"': etc etc; Note the nested ' and " and also the : and ; that must be there. The : and ; require the whole string to be surrounded by quotation marks. However, if I do that, I have trouble escaping the quotation marks. The command is: echo "bla bla bla 'foo foo foo "bar bar bar"': etc etc;" >> outfile How can I escape the quotation marks around bar bar bar so that they

Redirecting stderr in csh

◇◆丶佛笑我妖孽 提交于 2019-12-10 02:36:21
问题 I'm executing a program that dumps crash report into STDERR from where I have to filter some necessary information. The problem is that I'm unable to redirect STDERR to STDOUT and PIPE it with grep command 2>&1 >/dev/null | grep "^[^-]" >& /tmp/fl Getting error: Ambiguous output redirect. Same command works under bash terminal. What should I change to make it work ? 回答1: csh is significantly more limited than bash when it comes to file redirection. In csh , you can redirect stdout with the