command-line

gcc and g++ command prompt compiling and linking

Hey there, I have a small problem with compiling and linking with the command prompt(windows xp). Every .c file and .cpp file I compile or link has to be in the same directory as gcc (C:\Program Files\gcc\bin) and its quite hard to keep track of my files among all those gcc related files and its annoying too:). My question is how do I co...

Generic awk script to calculate average on any field through command line argument

Hi, I want to write a generic awk script that can take as input a file and a field number (in that file) and give me the average value of that field in that file. I would use it something like this: bash$ avg.awk 3 input.file 22 bash$ avg.awk 4 input.file 2001 Of course, I can write the script if I know which field (e.g., $3) I am go...

best C++ command line argument parser

Possible Duplicates: What parameter parser libraries are there for C++? C++ Parse Command Line Arguments What is the best C++ command line argument parser that you can suggest? ...

TFS baseless merge on specific changesets

As with most things in TFS you get more than you bargained for. In this case I am seeing more file changes during the merge than I was expecting. I have 2 child branches, lets be exciting and call them branch1 and branch2. Both have changes made to them since they were created. I need to take 12 specific changesets from branch2 and me...

powershell history: how do you prevent duplicate commands

Background: Powershell history is a lot more useful to me now that I have a way to save history across sessions. // run this every time right before you exit powershell get-history -Count $MaximumHistoryCount | export-clixml $IniFileCmdHistory; Now, I'm trying to prevent bash powershell from saving duplicate commands to my history. ...

Increase JVM heap size for Scala?

I have a Scala data processing tool which is failing with a java.lang.OutOfMemoryError exception. The tool needs to make a couple passes over a large data file (the one I'm working on is over 700MB), so it would be convenient if the entire thing could be stored in memory. I run the tool from the command line or from a Bash script using ...

Is there a way to run a command line command from JScript (not javascript) in Windows Scripting Host (WSH) cscript.exe ?

I'm writing a JScript program which is run in cscript.exe. Is it possible to run a commnad line command from within the script. It would really make the job easy, as I can run certain commands instead of writing more code in jscript to do the same thing. For example: In order to wait for a keypress for 10 seconds, I could straight awa...

Python imaging alternatives

I have python code that needs to do just a couple simple things to photographs: crop, resize, and overlay a watermark. I've used PIL, and the resample/resize results are TERRIBLE. I've used imagemagick, and the interface and commands were designed by packaging a cat in a box, and then repeatedly throwing it down a set of stairs at a keyb...

Lauch default editor (like 'webbrowser' module)

Is there a simple way to lauch the systems default editor from a Python command-line tool, like the webbrowser module? ...

Command to Bulk Compress All Files / Folders Under a Directory

I'm looking for a command that will compress every folder within a directory separately with the name of each archive reflecting the original folder name. I know that tar czvf example.tar.gz example/ will compress an entire folder. However, I have not found a command to bulk archive. Is there such a command? ...

Execute commands like in command prompt in vb.net

I know of the Shell method to run files, but how can I execute normal command prompt commands like nslookup, and capture the output as a string? Thanks for the help! Every google search has just turned up the shell method >_> ...

Converting shell script to Objective-C CLI

I am planning to convert a rather long shell script I have into an Objective C command line tool. I'm planning to use NSTask to run the shell commands (this is a large script, and it has several thousand copy/move/delete operations). My question is, will continually allocating and deallocating NSTask objects to run all these commands res...

Running Sybase SQL commands from DOS/Windows batch file

Is there any way I can run Sybase SQL commands from command prompt. I need to write a batch file which runs an SQL query on machine as a fix for a bug. ...

Prevent cl.exe from printing the compiled source file

I use the MS compiler from the command line (VS 2008), and whenever it compiles one source file, it prints the compiled source file. Is there a way to avoid this useless print ? ...

How to get PHP command line to work with PDO?

I want to work with PDO, through PHP command line. It works perfect through the PHP web API, but not through the command line. But when I execute the command: php test.php, it says unknown class PDO. I think it has something to do with the thread-safety difference. Because, when I execute the above command, the following warnings come:...

How do I run a command-line program in Delphi?

I need to execute a Windows "find" command from a Delphi software. I've tried to use the ShellExecute command, but it doesn't seem to work. In C, I'd use the system procedure, but here... I don't know. I'd like to do something like this: System('find "320" in.txt > out.txt'); Edit : Thanks for the answer :) I was trying to run 'Find' ...

.bat script only executes 1 line

I'm writing a script that performs the same function several times, but when I run the script only one of commands executes leaving the rest not executed after the .bat file has run. Does this have to do with the long time it takes for my commands to run (15-20 sec)? I've written plenty of bat files and I've never run into this. Do I n...

Changing a Visual Studio project using command line switches

I know very little about visual studio so the answer to this one might be simple; but is it possible to change settings in the project using command line switches to avoid having different project files for minor changes ? As I want to trigger automatic builds changing settings through the ui is not possible. For example something like ...

How to collect HDD size and available or used space in linux cli?

I'm trying to find some sort of command or regex to get the size and available or used space of a hard drive in linux. At the moment I'm using this; df -h and getting something like this; Filesystem Size Used Avail Use% Mounted on /dev/sda1 10G 3.1G 6.4G 33% / /dev/sda2 147G 5.8G 134G 5% /...

PHP mail() works from command line but not apache

I'm trying to figure out why the mail function in PHP fails when called via web browser (i.e. apache), but I can run the same script from the command line using php -f mailtest.php This is one of my client's Fedora servers, so I don't grok it completely, but I do have root access should I need to change anything. from php.ini: ...