spaces

Bash variables with spaces

假如想象 提交于 2019-12-28 03:56:07
问题 I'm facing the next problem in MinGW shell under windows. I have in my /etc/profile the next expression: export GIT_SSH="/c/Program Files/TortoiseGit/bin/TortoisePlink.exe" This doesn't work when I use git fetch on the local repository. But if I do it like (old dos way) this it works: export GIT_SSH="/c/Progra~1/TortoiseGit/bin/TortoisePlink.exe" My question is: How can I make it work using spaces in the variable? For testing purpose you can simulate something like this (any example is good):

Git Merge and Fixing Mixed Spaces and Tabs with two Branches

走远了吗. 提交于 2019-12-28 03:25:06
问题 I've gone through some similar SOQ's and have not seen an adequate solution for this case. I've noticed that in many files there is a dirty mix of tabs and spaces used for indenting. The coding standard we follow uses 4 spaces for a tab currently. Although this should have been addressed when it happened, I need to consider it now and would like to fix the files I come across. The issue is that there are two teams using different branches of code and we will eventually have to merge those

How can I remove all extraneous spaces from a *.docx file?

妖精的绣舞 提交于 2019-12-25 07:46:26
问题 I want to remove all superfluous spaces from a .docx file. If there are cases where there are more than two, to accomplish this manually I need to do a search-and-replace for two spaces multiple times to get all of them, and it's hard to tell when I'm "finished." 回答1: This code, using the docx library, accomplishes it: private void RemoveSuperfluousSpaces(string filename) { bool superfluousSpacesFound = true; using (DocX document = DocX.Load(filename)) { List<int> multipleSpacesLocs; while

Batch File: How can I have a function return a value when the parameter passed to that function contains spaces?

醉酒当歌 提交于 2019-12-24 20:58:49
问题 I will try to explain as clearly as possible. My scenario starts with a txt file, cases.txt, that contains two lines: line1 () CASE1 line2 () CASE 2 The batch file iterates through that file using a FOR loop and passes each line to a function, find_index, that extracts (and should return) the location of the ')' character. Here is the code that I can't get working: @ECHO off SETLOCAL ENABLEDELAYEDEXPANSION FOR /f "delims=" %%a IN (cases.txt) DO ( ECHO %%a CALL :find_index %%a INDEX ECHO Found

Keep spaces when using sed command in kornshell script

青春壹個敷衍的年華 提交于 2019-12-24 05:26:12
问题 I'm having some trouble with the sed command : I'd like to replace in a string, a single quote by two single quote Here's my string : 04CA07807800106109XE00187200000081960 NI 0780643442 178'0700 I used this sed command to replace the single quote : line=`echo $line | sed "s/'/''/g"` The result is 04CA07807800106109XE00187200000081960 NI 0780643442 178''0700 As you can see, the single quote is properly replaced by two single quotes. But I lost all the spaces between each character of my string

How to avoid spaces when wrapping markup across multiple lines

…衆ロ難τιáo~ 提交于 2019-12-24 01:25:12
问题 friends. I'm using atom to write html codes. Every time I input the word "p", it can generate 3-line codes automatically: <p> </p> now I give a inline class to put two p elements in one line: .inline { display:inline-block; } <p class="inline"> Hi, friend </p> <p class="inline"> s </p> I want it shows "Hi, friends" in browser, but it shows "Hi, friend s" with a space between "friend" and "s". I know the problem is that html treats a line-break as a space.So if I write the code as <p class=

cd(1) and variables with spaces (cygwin)

人走茶凉 提交于 2019-12-23 15:54:19
问题 I've been having quite an unusual problem. In my .bashrc file, I have set a variable to a path name with spaces in it. I had a feeling this would cause problems, but I played around with setting an alias in a similar way and got it to work like so: alias npp="\"/cygdrive/c/Program Files (x86)/Notepad++/notepad++.exe\"" Now, I thought I could use the same trick for my environment variable - export PRO="\"/cygdrive/c/Program Files (x86)\"" This worked. Kind of. [myName] $ echo $PRO "/cygdrive/c

Should environment variables that contain a executable-path with spaces also contain the necessary quotes?

我与影子孤独终老i 提交于 2019-12-23 10:58:55
问题 When defining an environment variable (on Windows for me, maybe there is a more general guideline) set MY_TOOL=C:\DevTools\bin\mytool.exe if the tool is located on a path with spaces set MY_TOOL=C:\Program Files (x86)\Foobar\bin\mytool.exe should the environment variable already contain the necessary spaces? That is, should it read: set MY_TOOL="C:\Program Files (x86)\Foobar\bin\mytool.exe" instead of the above version without spaces? Note: In light of Joeys answer, I really should narrow

Should environment variables that contain a executable-path with spaces also contain the necessary quotes?

。_饼干妹妹 提交于 2019-12-23 10:57:04
问题 When defining an environment variable (on Windows for me, maybe there is a more general guideline) set MY_TOOL=C:\DevTools\bin\mytool.exe if the tool is located on a path with spaces set MY_TOOL=C:\Program Files (x86)\Foobar\bin\mytool.exe should the environment variable already contain the necessary spaces? That is, should it read: set MY_TOOL="C:\Program Files (x86)\Foobar\bin\mytool.exe" instead of the above version without spaces? Note: In light of Joeys answer, I really should narrow

Emacs global configuration of tabs

巧了我就是萌 提交于 2019-12-23 09:29:57
问题 I'm attempting to switch from Vim to Emacs, but I'm tearing my hair out trying to configure it to treat tabs how I wish. I require: Inserted "tabs" to be expanded into two spaces. Emacs stubbornly sticks to eight, no matter what I do. Tabs (i.e. real \t characters) to be represented on screen by two spaces. Pressing TAB should insert a tab at the cursor rather than indent the entire line . Currently, I press TAB anywhere and Emacs destroys all whitespace at the start of the line; this is the