terminal

Nodejs process.stdin.resume() doesn't work in Cygwin

喜你入骨 提交于 2019-12-22 12:52:19
问题 Trying to make a CLI type program - waiting for user input. In Cygwin, the script just exits. Just this in the script process.stdin.resume() Seems to work on a Linux VM. Works on Windows Command line also. Im assuming 'terminal' stuff regarding Cygwin.. 回答1: The symptom is that Cygwin process.stdin.on('data', cb); and process.stdin.on('end', cb); doesn't get called. I found a workaround for it Versions > ver Microsoft Windows [Version 6.1.7601] $ uname -a CYGWIN_NT-6.1 localhost 1.7.28(0.271

python virtualenv and flask installation. No module named flask

*爱你&永不变心* 提交于 2019-12-22 12:41:45
问题 I keep getting this error when running the basic program. ImportError: No module named flask Here's the basic prog: from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello World!' if __name__ == '__main__': app.run() when I run which Flask on the folder it doesn't return the location. But if I run the pip install from there it says it's already installed. 回答1: If your want to create a project with Flask and VirtualENV, you should follow the steps below,

How can I pipe from terminal in Perl without losing color?

百般思念 提交于 2019-12-22 10:53:56
问题 I'm trying to write a perl script which takes the output of colorgcc (or any other script that prints colored text to terminal), adds/removes parts of the string, and then prints the result in the same color as the input string. The following code will print "Hello World" in front of each line produced by the color_producing_script . The output will be all black, while the input is multicolored. How can I modified this script to conserve the original colors? open(CMD, "color_producing_script

Is it possible to compile C++ code to .exe on a Mac? [closed]

落爺英雄遲暮 提交于 2019-12-22 10:52:53
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I bought a pre-owned Macbook a little while ago and I've been coding inside Sublime Text 2 and compiling in Terminal with g++*. I wrote a stupid text adventure that I'd like to send to a friend and if possible, I

bash - Shell script opening multiple terminals and executing distinct commands [closed]

可紊 提交于 2019-12-22 10:36:36
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . I've tried to write my own shell script. So far I've managed to open 4 xterminals that can only execute ONE command because of the 'hold' option. If i don't use this option, the terminals just disappear. Here is my code : #!/bin/sh xterm -title "App 1" -hold -e mycommand | mysecondcommand & xterm

“sort filename | uniq” does not work on large files

假装没事ソ 提交于 2019-12-22 10:33:23
问题 I can remove duplicate entries from small text files, but not large text files. I have a file that's 4MB. The beginning of the file looks like this: aa aah aahed aahed aahing aahing aahs aahs aal aalii aalii aaliis aaliis ... I want to remove the duplicates. For example, "aahed" shows up twice, and I would only like it to show up once. No matter what one-liner I've tried, the big list will not change. If It type: sort big_list.txt | uniq | less I see: aa aah aahed aahed <-- didn't get rid of

Bash: How to print the filename of the nth file in a folder

Deadly 提交于 2019-12-22 10:07:21
问题 I'm getting a parsing error in the 773rd file of a folder. Is it possible to print the name of the file in bash? I've tried using this to print it but it returns a blank. files=(/path/to/files) echo "${files[773]}" 回答1: Very close, but you need to actually do a glob to collect the list into your array, rather than having a list with only one element (the parent directory): files=( /path/to/files/* ) echo "${files[772]}" If you want to represent your filename in a way that represents

Setting up Git osxkeychain error

徘徊边缘 提交于 2019-12-22 09:59:17
问题 I'm setting up Git and I am following http://lifehacker.com/5983680/how-the-heck-do-i-use-github along with the regular tutorial Git provides. My problem is I don't want to have to type in my password each time so I am following this tutorial and when I arrive at the step where you input the git config —global credential.helper osxkeychain command, I get the error error: key does not contain a section: —global. If I ls it, it shows the git-credential-osxkeychain in my current directory but I

What's the difference between ` and ' in bash?

旧时模样 提交于 2019-12-22 09:47:55
问题 Running this statement in OS X Terminal for i in `ls -v *.mkv`; do echo $i; done will successfully print out all the file names in the directory in name order with each file name on its own line. Source: This StackOverFlow answer However, if I run this statement in OS X Terminal for i in 'ls -v *.mkv'; do echo $i; done the output is "ls -v fileName1.mkv fileName2.mkv", etc. with all the file names concatenated into one long line (as opposed to each being printed on its own line). My questions

Is it possible to clone existing cloud code already deployed on server side, through the Parse command line tool?

自作多情 提交于 2019-12-22 09:26:03
问题 How can I clone an existing Parse Cloud Project files to my computer with the command line tool? I tried parse new and selected a project but it created a folder with new files, not the files that I already had in the Parse Cloud. Note: I did not find clue regarding that point in the Parse cloud code documentation neither via Google. Thanks! 回答1: With the new release of parse-cli, this is possible now. Make sure your cli is at least at version 2.2.5 Follow below instructions to download cloud