command-line

How do I get a handle to split_winmain

I am trying to get a get the boost library program_options working on a simple windows console library. I have linked in the library C:\Program Files\boost\boost_1_40\lib\libboost_program_options-vc90-s-1_40.lib Included the header files #include <boost/program_options.hpp> #include <boost/program_options/config.hpp> #include <boost/pro...

How do I get the command line arguments in Go without the "flags" package?

I'm trying to write a GNU-style command-line parser for Go, since the flags package doesn't handle all these yet: program -aAtGc --long-option-1 argument-to-1 --long-option-2 -- real-argument Obviously, I don't want to use the flags package, since I'm trying to replace it. Is there any other way to get to the command line? ...

Can you mass edit all files returned in a grep?

I want to mass-edit a ton of files that are returned in a grep. (I know, I should get better at sed). So if I do: grep -rnI 'xg_icon-*' How do I pipe all of those files into vi? ...

"Can't call method "dir_path" on an undefined value" when running Mason component on the command line

Greetings, I'm trying to develop some tests for Mason components which requires running them on the command line instead of the web server. When I try this, I get an error: perl -MHTML::Mason::Request -MHTML::Mason::Interp -I./lib \ -e '$int = HTML::Mason::Interp->new( data_dir => "/home/friedo/cache", comp_root => "/home/friedo/comps"...

Asterisk (*) in windows batch file command line argument gets expanded

Hello, I have a batch script that takes arguments from the command line. One of the arguments has a * in it. In spite of putting the argument in quotes, the * gets expanded before the argument gets used in the batch script. I am using the following code to parse the arguments: set CMDLINE_ARGS=%~1 shift :get_args if "%~1" == "" goto ...

How to read lines from a text file one by one with Power Point VBA code?

This code will read a line from a text file: set file = CreateObject("Scripting.FileSystemObject").OpenTextFile("c:\number.txt", 1) text = file.ReadLine MsgBox text How can I make it read repeatedly one line after another from the same file? I guess, I should use a loop here, right? I need it to read the first line from the file at th...

How does pylint quit the Windows command box it is running in?

Pylint is doing something odd on my Windows box - something that shouldn't be possible. This isn't a question about fixing pylint, so much as fixing my understanding. I have a typical install of the latest version of pylint, Python 2.6 and Windows Vista. If I open a Command Prompt, and run pylint from the command line, it executes succ...

What does this Python code do: shell=(sys.platform!="win32"))

I don't understand what this code is doing, I'm wanting to run a command line, in Mac OS X, the code I'm using is from somebody running a Windows command line. The command still executes, but I'd like to know what the sys.platform!="win32" is for, and if I should change it to something else for Mac OS X. It seems to be saying sys.pla...

Using 'diff' (or anything else) to get character-level diff between text files

Hi everyone, I'd like to use 'diff' to get a both line difference between and character difference. For example, consider: File 1 abcde abc abcccd File 2 abcde ab abccc Using diff -u I get: @@ -1,3 +1,3 @@ abcde -abc -abcccd \ No newline at end of file +ab +abccc \ No newline at end of file However, it only shows me that were...

Text disappears when typing long commands in zsh on OSX?

When I'm typing a command longer than around 20 characters the text disappears and the cursor moves to a different location in the terminal. How do I stop this? I find it difficult to understand what I'm doing when this happens. ...

Need help in finding the root cause in this wrong batch command

IF %processor_architecture% == AMD64 (SET querypath=hklm\software\x) ELSE (SET dsetquerypath=hklm\software\y) FOR /F "tokens=* delims=\" %%G IN ('REG QUERY "%querypath%" 2^>NUL') DO ECHO %%G Let me explain what im trying to accomplish out of this batch command. Basically there is a tool which gets intalled on hklm\software\x(on 32bit ...

Multiline progress bars

I know that to update something like a progress bar on the command line, one uses '\r'. Is there any way to update multiple lines? ...

Team City Command Line Build Runner

In Team City, we are currently using a command line build runner. While it works just fine, we don't get any output shown in the Team City log. We essentially get a notification that the process started, and that the process exited with a particular exit code. Is there a way to pipe the output of the command line call to the log so t...

In C how do I print filename of file that is redirected as input in shell

$cc a.c $./a.out < inpfilename I want to print inpfilename on stdout. How do I do that ? Thanks for the help in advance... ...

R - capturing elements of R output into text files

I am trying to run an analysis by invoking R through the command line as follows: R --no-save < SampleProgram.R > SampleProgram.opt For example, consider the simple R program below: mydata = read.csv("test.txt", header=T) attach(mydata) summary(Variable1) q() The output is displayed in SampleProgram.opt (only partially shown): ...

Why %processor_architecture% always returns x86 instead of AMD64

I am trying to retrieve the environment variable to detect whether the system is 32 or 64 bit. But on 64 bit server the environment variable %processor_architecture% is returning x86 instead of AMD64. Does anyone has any clue about this? ...

How can I run a curl command for each line of output from my Perl script?

I have a perl script that writes out an array filled with integers to stdout, each on a separate line. So I would get output like: 412 917 1 etc What I would like to do is be able to pipe the output of this script into xargs, and make a curl call using each integer. Something like this: cat input.json | ./jsonValueExtracter.pl -s e...

How do I get the output of a Perl script into a file from the DOS prompt?

I'm generating a large XML document via a Perl script in a command window, however, currently it's printing the document to standard out. The Perl script modifiers do not have a switch to allow to write to a file, so I'm curious how to take an input string and write to a file via the base command shell. My current order of operations: ...

Read from File, or STDIN

I've written a command line utility that uses getopt for parsing arguments given on the command line. I would also like to have a filename be an optional argument, such as it is in other utilities like grep, cut etc. So, I would like it to have the following usage tool -d character -f integer [filename] How can I implement the followi...

Command Line Parameters

I'm trying to add my file in Visual Studio as command line parameters. I know my code works since when I use fopen("whole path here", "r"), it runs. I then add the file as a command line parameter instead, and I get no such file or directory. Any thoughts? Thanks. ...