csh

Customize CSH prompt for Git repo

寵の児 提交于 2019-12-19 04:24:10
问题 I want to have a custom CSH prompt when I am inside a Git repo. I want the prompt to look like this if I am not in a git repo host_name>$ But when I am inside a Git repo must turn into something like this host_name [GIT REPO ROOT DIR]>$ I just want to display the root of the Git repo (GIT REPO ROOT DIR), so that I know in which repo I am currently in. Instead of using 'pwd' everytime. Do you guys have any suggesstions on achieveing this? Thanks for the help -Anish 回答1: Here's how I did it for

Customize CSH prompt for Git repo

依然范特西╮ 提交于 2019-12-19 04:23:50
问题 I want to have a custom CSH prompt when I am inside a Git repo. I want the prompt to look like this if I am not in a git repo host_name>$ But when I am inside a Git repo must turn into something like this host_name [GIT REPO ROOT DIR]>$ I just want to display the root of the Git repo (GIT REPO ROOT DIR), so that I know in which repo I am currently in. Instead of using 'pwd' everytime. Do you guys have any suggesstions on achieveing this? Thanks for the help -Anish 回答1: Here's how I did it for

Output of last shell command

三世轮回 提交于 2019-12-18 11:40:52
问题 Not until midway through a 3 hour build script, I'll remember that I want to see something at the beginning of the output after it's done. At this point I've exceeded the number of lines in my terminal so I can't scroll up to see it (or the beginning is hard to find). Of course I can be better about storing my output, but I've always been curious if this were possible. In a linux shell, is it possible to return the output of the last command. I realize I could have piped it or sent the output

removing new line character from incoming stream using sed

一曲冷凌霜 提交于 2019-12-18 10:39:25
问题 I am new to shell scripting and i am trying to remove new line character from each line using SED. this is what i have done so far : printf "{new\nto\nlinux}" | sed ':a;N;s/\n/ /g' removes only Ist new line character. I somewhere found this command : printf "{new\nto\nlinux}" | sed ':a;N;$!ba;s/\n/ /g' but it gives :"ba: Event not found." if i do: printf "{new\nto\nlinux}" | sed ':a;N;s/\n/ /g' | sed ':a;N;s/\n/ /g' then it gives correct output but i am looking for something better as i am

Not able to set LD_LIBRARY_PATH for Java process

孤人 提交于 2019-12-18 05:05:28
问题 I am trying to call my linux executable from shell script. Before calling this executable, I want to set LD_LIBRARY_PATH with specific values. My shell script is as below: Parent.sh (contains 2 lines) - source set_env.sh - executable.so Set_env.sh - setenv LD_LIBRARY_PATH /proj/something On manually executing Parent.sh scipt from linux console, the executable.so is called with LD_LIBRARY_PATH set correctly. But after integrating it wiht java code as: String[] commandArray ={"Parent.sh"};

Csh adding strings to an array, whitespace troubles

孤者浪人 提交于 2019-12-18 04:54:15
问题 I’m having trouble doing something basic with csh. I have a string: set newCmd = "$expansionCmd –option1 –option2 …" And I’m creating an array of these strings, which I later want to execute: set expansionCmdList = ($expansionCmdList[*] "$newCmd") #I also tried without quotes, e.g. just $newCmd Finally I try to iterate over and execute these commands: foreach exCmd ($expansionCmdList) `exCmd` #execute it in the shell end However the problem is that the array entries are not the full string,

MVC 3 Razor @Html.ValidationMessageFor not working in partial loaded via jquery.load()

半世苍凉 提交于 2019-12-17 23:08:37
问题 I have put together a small example here just to replicate the problem. I have a strongly typed partial view _Name.cshtml: @model ValidationInPartial.ViewModels.MyViewModel <h2>@ViewBag.Message</h2> <fieldset> <legend>Name</legend> <div class="editor-label"> @Html.LabelFor(model => model.MyName) </div> <div class="editor-field"> @Html.EditorFor(model => model.MyName) @Html.ValidationMessageFor(model => model.MyName) </div> <a href="#" id="reload">Reload Name</a> <p> <input type="submit" value

Edit shell script while it's running

*爱你&永不变心* 提交于 2019-12-17 06:33:46
问题 Can you edit a shell script while it's running and have the changes affect the running script? I'm curious about the specific case of a csh script I have that batch runs a bunch of different build flavors and runs all night. If something occurs to me mid operation, I'd like to go in and add additional commands, or comment out un-executed ones. If not possible, is there any shell or batch-mechanism that would allow me to do this? Of course I've tried it, but it will be hours before I see if it

Setting stacksize in a python script

非 Y 不嫁゛ 提交于 2019-12-17 05:08:23
问题 I am converting a csh script to a python script. The script calls a memory-intensive executable which requires a very large stack, so the csh script sets the stacksize to unlimited: limit stacksize unlimited When I try to reproduce this script in python, I execute them in a very naive manner, using os.system , e.g.: os.system('some_executable') But I do not know how to tell the OS to run these executables with unlimited stacksize. Is there a way to specify stacksize for calls within a python

csh script as executable does not setenv

China☆狼群 提交于 2019-12-14 02:15:44
问题 I am not able to set env variables through an executable csh/tcsh script An env variable set inside a csh/tcsh executable script "myscript" contents of the script ... setenv MYVAR /abc/xyz which is not able to set on the shell and reports "Undefined variable" I have made the csh/tcsh script as executable by the following shell command chmod +x /home/xx/bin/myscript also the path is updated to set path = (/home/xx/bin $path) which myscript /home/xx/bin/myscript When I run the script on command