command-line

What should COMSPEC and PATH environmental variables be to locate the command-interpreter, using system()?

Are the OS (XP) environmental variables the same used in a process running from visual studio .NET C++? It seems the command interpreter is not found: When using NULL as the command, system() returns 0 and with command - ENOENT Command interpreter cannot be found. In windows (System->Environmental Variables), COMSPEC contains the pa...

how do I launch a url in firefox in the background from Ubuntu command line?

I use this command from the Terminal to launch a url in Firefox: firefox reader.google.com & I put the ampersand at the end so that it won't put my Terminal window in the background, but Gnome just ignores this and opens a new Firefox browser window on top of the Terminal. Is there a way to launch Firefox behind the Terminal? What I w...

Why the \G in SELECT * FROM table_name\G?

Terminating a MySQL query with \G instead of ; will cause MySQL to return the result set in vertical format, which is sometimes easier to read if the number of returned columns is large. Example: mysql> SELECT * FROM help_keyword LIMIT 3\G *************************** 1. row *************************** help_keyword_id: 0 name...

How can I keep a Python script command window open when opened from a .Net application?

Now the obvious answer is to just open the script from a command line, but that isn't an option. I'm writing a simple application to syntax highlight Python and then run the scripts from the same program. A Python IDE if you will. The scripts I want to run are entirely command line programs. I'm using a System.Diagnostics.Process obj...

Python, trying to run a program from the command prompt

Hi All, I am trying to run a program from the command prompt in windows. I am having some issues. The code is below: commandString = "'C:\Program Files\WebShot\webshotcmd.exe' //url '" + columns[3] + "' //out '"+columns[1]+"~"+columns[2]+".jpg'" os.system(commandString) time.sleep(10) So with the single quotes I get "The filename, di...

How to echo directories containing matching file with Bash?

I want to write a bash script which will use a list of all the directories containing specific files. I can use find to echo the path of each and every matching file. I only want to list the path to the directory containing at least one matching file. For example, given the following directory structure: dir1/ matches1 matches...

How to pass in a null character in a command line argument in C?

I would still like to know how to pass in a null character as a command line argument, maybe so that a single string can be passed in as an argument in the form: "to\0be\0or\0not\0to\0be\0" And then parse it. However the program would treat this string as: "to\\0be\\0or\\0not\\0to\\0be\\0" How can I work around this? Is ther...

How to trigger XDebug for a command line PHP script?

XDebug offers the configuration directive "xdebug.profiler_enable_trigger" that allows to activate profiling by passing the GET or POST parameter "XDEBUG_PROFILE" when calling a script via HTTP. This is handy if you don't want profiling for ALL of your scripts but only for a few special cases without always changing your PHP configuratio...

What are the standard return values for a command line application?

I know that a command line application should return 0 on success. But are there any "standards" for what other values refer to? e.g. Invalid Arguments, etc. Are there differences under Windows and Unix? ...

How can I get the list of properties that MSBuild was invoked with?

Given this command: MSBuild.exe build.xml /p:Configuration=Live /p:UseMerge=true /p:EnableUpdateable=false how can I form a string like this in my build script: UseMerge=true;EnableUpdateable=true where I might not know which properties were used at the command line. ...

Make a Linux "GUI" in the command line.

Hi, How to make a Linux program in the Command Line Interface who display a nice user interface? For example when I use "wget" to download a file from internet, I can see the download avancement in the Command Line Interface. How can I do that ? Thank's Martin Magakian ...

command line tool for print picture?

My program need to print a curve, my solution is changing the curve into a picture, and this picture file (xxx.png) can be printed by using the default windows picture printing tool(right click the mouse on top of the file, and select print). but I don't want user do this job manually, I need a command line tool to do this: printPictur...

Approach for representing command-line interface commands in code: Implementation of "database" where a query and result is obtained from proprietary CLI commands.

Problem Domain: I am working on a new revision of a Java application that connects via SSH to a proprietary, Linux-based platform's Command Line Interface (CLI). Everything on the platform that I would want to do or know is only available via CLI commands and stdout. One of the commands available retrieves information from an intern...

Copy the contents of a file to one field in mysql

Is it possible to copy the contents of a file into a field in a mysql table from the command line? Either at the command line or the mysql prompt. I don't want to have to write a script if there is an easier way. Ideally, I'd like something like: UPDATE MYTABLE SET MYFIELD=READ_CONTENTS_OF_FILE('myfile.txt') WHERE ID=1234; Obviously ...

What character sequence should i not allow in a filename?

I found out and tested linux allows any character as a file name except for / and null. So what sequence should i not allow in a filename? I heard a leading - may confuse some command line programs which doesnt matter to me however it may bother other people if they decide to collect a bunch of files and filter it with some GNU programs....

calling command line from .NET application

I want to call from a c# application a command line starting from it an application and retrieve the stat from it. I did this but something is missing: ProcessStartInfo psf = new ProcessStartInfo("cmd.exe", "/C time"); psf.WindowStyle = ProcessWindowStyle.Hidden; psf.RedirectStandardOutput = true; psf.UseShellExecute = false; psf.Creat...

How can I pass arguments to an external process from Perl?

I have a application executable, which runs with different parameters to produce different outputs. I want to give some parameters to this from the command line parameters of the script and others will be local to the script. Usage: ./dump-output.pl <version> <folder-name> <output-file> my $version = $ARGV[0]; my $foldername = $ARGV[1...

Compiling a single .cpp in VS 2008 w/ the Command Line

I was using MinGW's GCC manually without a makefile to compile a DLL. It's since proved ridiculously hard to get more than one MinGW DLL running in an app compiled with Visual Studio. I've decided to compile the DLL with the Visual Studio 2008 Command Line, but I'm having a hard time figuring out how to do that. It seems there are sizab...

ec2 workflow microsoft / apple

I'm switching over to EC2 and obviously it's easiest to manage instances through a command line rather than some crappy web interface, but I work on a PC and have everything set up in Windows. What is the best way to work with dev server instances? Putty? Is there an alternative? What do you guys use? Thanks! ...

How to compile an iPhone application source code on server using command line in Windows?

I have an application in which I change the data on web and then download the files then I compile my iPhone app with data. I just want to create ad-hoc distribution so I have already added devices. So is there a way that anytime I change data on web then I compile my iPhone app over the server using PHP and some command-line script so...