terminal

How do i run a UNIX terminal from Java and send commands to it?

倖福魔咒の 提交于 2019-12-19 04:19:09
问题 Regarding the topic, the code below Process proc = null; try { String[] cmdss= {"gnome-terminal"}; proc = Runtime.getRuntime().exec(cmdss, null, wd); } catch (IOException e) { e.printStackTrace(); } Runs the terminal form Ubuntu. How do I issue commands into the terminal after running the termnal? eg: running the terminal and run command such as "ls" etc. 回答1: You can give gnome-terminal some options on the command line what it shall execute. gnome-terminal -e /my/fortran/program The -x

Can't use GCC in OS X Terminal

非 Y 不嫁゛ 提交于 2019-12-19 04:14:50
问题 I have installed the developer tools. I can compile code via Xcode and according to the docs /usr/bin/gcc & /usr/bin/cc should point to /usr/bin/gcc-4.0. Neither the symlinks or gcc-4.0 exist on my system (Snow Leopard). All I wish to do is compile some C on the terminal! I'm amazed by how complicated this task is. The command GCC is unsurprisingly returning "gcc: command not found". Can anyone shed some light on this? 回答1: Did you install the latest Xcode after installing Snow Leopard, or is

Listen EADDRINUSE error while debugging in sails

两盒软妹~` 提交于 2019-12-19 03:44:23
问题 I am trying to debug my code using node-inspector but I am getting this error in my Terminal window again and again $ sudo sails debug info: Running app in debug mode... info: You probably want to install / run node-inspector to help with debugging! info: https://github.com/node-inspector/node-inspector info: ( to exit, type <CTRL>+<C> ) Error: listen EADDRINUSE at exports._errnoException (util.js:746:11) at Agent.Server._listen2 (net.js:1156:14) at listen (net.js:1182:10) at Agent.Server

Get output of terminal command using Java

廉价感情. 提交于 2019-12-19 03:22:48
问题 For some terminal commands, they repeatedly output. For example, for something that's generating a file, it may output the percent that it is complete. I know how to call terminal commands in Java using Process p = Runtime.getRuntim().exec("command goes here"); but that doesn't give me a live feed of the current output of the command. How can I do this so that I can do a System.out.println() every 100 milliseconds, for example, to see what the most recent output of the process was. 回答1: You

How can I permanently add a class path to my Mac terminal?

只愿长相守 提交于 2019-12-19 03:21:14
问题 I want to set my path permanently for the following directory: /Users/syalam/Library/android-sdk-mac_86/platform-tools Not sure how to do it from the terminal. I tried: export PATH=$PATH:/Users/syalam/Library/android-sdk-mac_86/platform-tools but it only works temporarily. After I close my shell it no longer exists. 回答1: Just add this entry to your CLASSPATH environment variable in your .bashrc : export CLASSPATH="/Users/syalam/Library/android-sdk-mac_86/platform-tools:$CLASSPATH" 回答2: http:/

How can I permanently add a class path to my Mac terminal?

荒凉一梦 提交于 2019-12-19 03:20:04
问题 I want to set my path permanently for the following directory: /Users/syalam/Library/android-sdk-mac_86/platform-tools Not sure how to do it from the terminal. I tried: export PATH=$PATH:/Users/syalam/Library/android-sdk-mac_86/platform-tools but it only works temporarily. After I close my shell it no longer exists. 回答1: Just add this entry to your CLASSPATH environment variable in your .bashrc : export CLASSPATH="/Users/syalam/Library/android-sdk-mac_86/platform-tools:$CLASSPATH" 回答2: http:/

How to launch a mac application without a terminal window

落花浮王杯 提交于 2019-12-19 02:48:21
问题 I've written an open-source c++ application and it works fine on Windows and Linux, I finally got a Mac Mini (with 10.5.8) so I've just been testing the Mac version. My application works fine when running it from inside a terminal window and typing ./appname , but if instead I double click on it from the finder, then it opens a termnial window first and then runs my app but it doesn't seem to set the working directory to the correct location so my app dies. How do I make my app so when it

How do you get the encoding of the terminal from within a python script?

怎甘沉沦 提交于 2019-12-18 19:10:17
问题 Let's say you want to start a python script with some parameters like python myscript some arguments I understand, that the strings sys.argv[1] and sys.argv[2] will have the encoding specified in the terminal. Is there a way to get this information from within the python script? My goal is something like this: terminal_enocding = some_way.to.GET_TERMINAL_ENCODING some = `sys.argv[1]`.decode(terminal_encoding) arguments = `sys.argv[2]`.decode(terminal_encoding) 回答1: sys.stdout.encoding will

Add/import certificate with password via command line Mac OS X

ぐ巨炮叔叔 提交于 2019-12-18 15:26:48
问题 I'm trying to import a .pfx certificate via command line. This certificate is secured by a password. Is there a way to do this in terminal? I'm running OS X 10.8. When I use this command I get the default pop-up asking for the password: security import certificate.pfx -k ~/Library/Keychains/login.keychain When I use this command: security import certificate.pfx -k ~/Library/Keychains/login.keychain -P password I get this error: SecKeychainItemImport: MAC verification failed during PKCS12

Xcrun PackageApplication, failed unable to copy application

杀马特。学长 韩版系。学妹 提交于 2019-12-18 15:02:40
问题 I've created a simple application in Xcode. Setted up a provisioning for Debug and Release configuration. I'm performing in terminal: xcodebuild -target signtest -configuration Debug -sdk iphoneos clean build And it is building correctly. Now I'm trying to make an ipa file with this command: /usr/bin/xcrun -sdk iphoneos PackageApplication -v /Users/admin/Desktop/signtest/signtest/build/Debug-iphoneos/signtest.app/ -o /Users/admin/Desktop/binaries/signtest.ipa And I'm getting this error: