command-line

Software to cd (change directories) into .jar/.ear files?

Is there any software/script that will allow me to cd (change directories) into .jar/.ear/.zip files and edit the contents of the files it contains? I'm working on a large EJB project (yuck), and I frequently find myself in situations like the following: something.ear/ |-- something.jar/ | `-- fileINeedToEdit.xml I work primarily v...

Command to Change Build Action="None"

Hi Guys, I am trying to build a command line script which changes a bunch of files to build action="none" in VS2008. I was hoping to then be able to run a post-build command to change it back again [for debug] Anyone know how I could set this up as an external .cmd file ? ...

How do I get the name of the newest file via the Terminal?

I'm trying to create a macro for Keyboard Maestro for OS X doing the following: Get name of newest file in a directory on my disk based on date created; Paste the text "newest file: " plus the name of the newest file. One of its options is to "Execute a shell script", so I thought that would do it for 1. After Googling around a bit I...

MonoDevelop in Linux -- Terminal Commands

Hi everyone, I want to make a C# app in Mono as it's the only programming language I'm mostly comfortable with. Anyway, ATI Drivers on Linux do not have a Fan control feature and therefore the cards to tend to heat up. For me I prefer to have a cooler card. What I want to do is run a command such as: aticonfig --pplib-cmd 'set fanspe...

[MSVC++ 2008] Using preprocessor directives to define command line options

If I wanted to add, let's say, a new .lib to the build only if a particular #define was set, how would I do that? In the MSVC++ 2008 "Property Pages", you would simply add: Config Properties -> Linker -> Input -> Additional Dependencies, but I would like it if something like #define COMPILE_WITH_DETOURS was set, then the particular libr...

Which command line tools can I use to get the currently active application / window on each platform?

I'm trying to create an AIR application to log application usage and the only easy way to get information from the system with AIR is using command line tools and scraping stdout. I know about tools like top and ps for OS X, but neither of them seems to tell me which application / window is active, maybe I shouldn't even be looking for ...

Spawn a multi-threaded Java program from a Windows command line program, spawner won't end until spawnee ends. How can I prevent the hang?

Short version: How can I prevent a spawned Java process in Windows from blocking the spawning process from ending? Long version: I'm trying to spawn a multi-threaded Java program (Selenium RC, not that it should matter) from a program launched from the Windows command line (NAnt's <exec> task, again, not that it should matter). I'm d...

zip -j command, what does the -j option mean?

Wondering what is the -j option mean in the zip command. I found the explanation as following: -j Store just the name of a saved file (junk the path), and do not store directory names. By default, zip will store the full path (relative to the current path). But not quite sure what it is exact mean? Can anyone explain it using the fol...

Run Debug mode from command line

Hi all, I want to run my project in debug mode from command line, not from visual studio (vs is open) Is there any parameter to add to the command? Thanks in advance! Edit: Actually I want to initialize Multiple instances of my project at the same time (from bat file) and debug them - instead of pressing multiple F5 ...

Is there a single Git command to get the current tag, branch and commit?

I'm currently using a collection of three commands to get the current tag, branch and the date and SHA1 of the most recent commit. git describe --always --tag git log -1 --format="%H%n%aD" git rev-parse --abbrev-ref HEAD Which will output something like: 1.2.3-5-gdeadbeef deadbeef3b8d90071c24f51ac8f26ce97a72727b Wed, 19 May 2010 09:1...

Ant: how do I disable all non-error messages?

Hello, everyone! When running ant from command line on my Netbeans projects, I get the following messages hundreds of times, which is very annoying: Trying to override old definition of task http://www.netbeans.org/ns/j2se-project/3:javac Trying to override old definition of task http://www.netbeans.org/ns/j2se-project/3:depend Trying ...

Shell - How to find directory of some command?

I know that when you are on shell, the only commands that can be used are the ones that can be found on some directory set on PATH. Even I don't know how to see what dirs are on my PATH variable (and this is another good question that could be answered), what I'd like to know is: I come to shell and write: $ lshw I want to know a ...

Is there a way to know if a Java program was started from the command line or from a jar file?

I want to either display a message in the console or a pop up, so in case a parameter is not specified, I want to know to which should I display Something like: if( !file.exists() ) { if( fromCommandLine()){ System.out.println("File doesn't exists"); }else if ( fromDoubleClickOnJar() ) { JOptionPane.showMessage(...

Is it possible to pass an array as a command line argument to a PHP script?

I'm maintaining a PHP library that is responsible for fetching and storing incoming data (POST, GET, command line arguments, etc). I've just fixed a bug that would not allow it to fetch array variables from POST and GET and I'm wondering whether this is also applicable to the part that deals with the command line. Can you pass an array...

Java slick command line app?

Hello Guys, I want to make a slick java commandline app which doesnt include all the nasty "java -jar some.jar arguments" instead, I would have it work just like program -option argument like any other commandline app. I use ubuntu linux, and it would be fine if it included a bit of .sh script or anything. I know I can just create a...

Correct to check for a command line flag in bash

In the middle of a scrip, I want to check if a given flag was passed on the command line. The following does what I want but seems ugly: if echo $* | grep -e "--flag" -q then echo ">>>> Running with flag" else echo ">>>> Running without flag" fi Is there a better way? Note: I explicitly don't want to list all the flags in a switc...

using a batch file, how can i delete all files not in the windows dir?

i have a litle project for which i would like to remove all files outside of and not needed by the c:\windows operating system. therefore i need to create a list of what i want to keep i.e. boot.ini c:\windows etc and then delete everything else. i have seen examples using forFile, but i can be sure that extension will be on the machine....

In Java, send commands to another command-line program

I am using Java on Windows XP and want to be able to send commands to another program such as telnet. I do not want to simply execute another program. I want to execute it, and then send it a sequence of commands once it's running. Here's my code of what I want to do, but it does not work: (If you uncomment and change the command to "cmd...

How to use http-delete from the shell

Is it possible to send a HTTP DELETE request from the shell and if so, how? ...

Curses for PHP on Windows

Is there a Windows equivalent of ncurses for PHP? I've created a CLI script and want to display various statistics (currently processed record, completion percentage etc.) in a nice way, without outputting loads and heaps of text to the cmd.exe window. The ncurses extension doesn't work on Windows. ...