terminal

How to run Java programs from the terminal?

一世执手 提交于 2020-01-11 06:54:08
问题 I am trying to run a Java program from my Terminal. I have Mac OS X 10.7. teamL javac -jar kxml2-2.3.0.jar XMLHandler.java ServiceEndpoint.java TeamL.java This is my Eclipse class file structure: I am not able to find why is this throwing Unable to access jarfile kxml2-2.3.0.jar ? 回答1: If you are referencing any external libraries, then you have to add them to the classpath . You can add it during compilation of the classes this way. Go to the src directory and : javac -classpath ".:<path_to

My shell prompt looks like this: ➜ ~ git:(master) ✗. How can I get my normal prompt back?

岁酱吖の 提交于 2020-01-11 06:46:09
问题 My normal terminal command line has suddenly disappeared and has been replaced by this git command line ➜ ~ git:(master) ✗ . How do I get rid of this and go back to my normal command line in Terminal? I on Mac OS X. I have tried typing exit , Ctrl + c , q , etc. but nothing helped. 回答1: I know your problem , You are using zsh , right? If so, you should add export PS1=xxxxx to ~/.zshrc , not ~/.bashrc . Or you just don't use zsh , input bash and switch to bash.input chsh -s /bin/bash to change

Using terminal, how do I make OS X use MAMPs version of PHP

一个人想着一个人 提交于 2020-01-11 04:16:25
问题 I'm currently learning the Yii framework, and one of the tutorials I was running through yesterday required me to test the database connection of a project. The details aren't too important here, but basically when I run shell, and type in the command it throws up an error as follows: server:trackstar charlieryan$ protected/yiic shell Yii Interactive Tool v1.1 (based on Yii v1.1.13) Please type 'help' for help. Type 'exit' to quit. echo Yii::app()->db->connectionString; PHP Warning: PDO::_

Golang write input and get output from terminal process

只愿长相守 提交于 2020-01-11 04:06:06
问题 I have a question regarding how to send input and receive output from a terminal subprocess such as ssh. An example in python would be something like this: how to give subprocess a password and get stdout at the same time I cannot find a simple example in Golang that is similar how the above work. In Golang I would want to do something like this but it does not seem to work: cmd := exec.Command("ssh", "user@x.x.x.x") cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr stdin, _ := cmd.StdinPipe()

Writing Ruby Console Output to Text File

本小妞迷上赌 提交于 2020-01-11 04:01:06
问题 I'm trying to run a Ruby application, which outputs information to the console. I'd like to make this output get saved to a text/log file. Is this even possible? There must be a flag for ruby to do this right? 回答1: Use shell redirections: ruby script.rb > out.txt rails server > out.txt On another note, you may also redirect $stdout, $stderr: $stdout = File.new('/path/to/out.txt', 'w') http://eddymulyono.livejournal.com/65791.html 来源: https://stackoverflow.com/questions/8720150/writing-ruby

Shortcut for running terminal command in VS code

邮差的信 提交于 2020-01-11 03:07:08
问题 Is there a way to make a hotkey for running specific command in terminal? Say I want to compile my TypeScript files by hotkey and not to type to terminal "tsc" or any other variation of that command. (Edit: I know it is possible to recompile TS on save, but the question is still the same) 回答1: Typically you would set up a build or another task or an npm script and then trigger that with a hotkey. There is another new way to do it with send text to the terminal. For example, try this in your

Catching a direct redirect to /dev/tty

假如想象 提交于 2020-01-11 03:05:10
问题 I'm working on an application controller for a program that is spitting text directly to /dev/tty. This is a production application controller that must be able to catch all text going to the terminal. Generally, this isn't a problem. We simply redirect stdout and stderr. This particular application is making direct calls to echo and redirecting the result to /dev/tty ( echo "some text" > /dev/tty ). Redirects via my application controller are failing to catch the text. I do have the source

Applescript (osascript): opening split panes in iTerm 2 and performing commands

雨燕双飞 提交于 2020-01-11 01:28:12
问题 The following works to open two tabs in iTerm 2. I can't seem to figure out how to get this to using split panes instead. I've tried applying what I see on several forums, but it never works. Could someone point me in the right direction? osascript <<-eof tell application "iterm" set myterm to (make new terminal) tell myterm launch session "Default session" tell the last session set name to "Server" write text "cd $projectsFolder" end tell launch session "Default session" tell the last

Extracting all lines from multiples files

喜夏-厌秋 提交于 2020-01-10 20:19:08
问题 I have 3 files: the first file is a list of IDs the second file is the source strings the third file is composed by target strings. Eg File 1 3952276-0-1 3952276-0-2 3952276-0-3 3952276-0-4 3952276-0-5 3952276-0-6 3952276-0-7 3952276-0-8 3952276-0-9 3952276-0-10 File 2 source-string1 source-string2 source-string3 source-string4 source-string5 source-string6 source-string7 source-string8 source-string9 source-string10 File 3 target-string1 target-string2 target-string3 target-string4 target

Extracting all lines from multiples files

爷,独闯天下 提交于 2020-01-10 20:19:05
问题 I have 3 files: the first file is a list of IDs the second file is the source strings the third file is composed by target strings. Eg File 1 3952276-0-1 3952276-0-2 3952276-0-3 3952276-0-4 3952276-0-5 3952276-0-6 3952276-0-7 3952276-0-8 3952276-0-9 3952276-0-10 File 2 source-string1 source-string2 source-string3 source-string4 source-string5 source-string6 source-string7 source-string8 source-string9 source-string10 File 3 target-string1 target-string2 target-string3 target-string4 target