command-line

How can I enable a debugging mode via a command-line switch for my Perl program?

I am learning Perl in a "head-first" manner. I am absolutely a newbie in this language: I am trying to have a debug_mode switch from CLI which can be used to control how my script works, by switching certain subroutines "on and off". And below is what I've got so far: #!/usr/bin/perl -s -w # purpose : make subroutine execution option...

how to make PHP lists all Linux Users?

Hello I want to build a php based site that (automate) some commands on my Ubuntu Server first thing I did was going to the file (sudoers) and add the user www-data so I can execute php commands with root privileges! # running the web apps with root power!!! www-data ALL=(ALL) NOPASSWD: ALL then my PHP code was <?php $command...

Cinema4D XML scene not rendering texture

I was playing with the Cinema 4D command line options and ran into a problem that might not be specific to the command line options. I saved a basic scene(a textured cube) in two formats: the original .c4d(binary) format and .xml(via File > Export > Cinema 4D XML). The .c4d file renders with the texture applied, while the .xml file ren...

Getting 'choice' to work in Highline Ruby Gem without error and getting variable from it

I'm having a couple of problems using Highline in Ruby, and trying to get the choice element, detailed here, to work. At the moment the following code produces the error "error: wrong number of arguments (0 for 1). Use --trace to view backtrace" How do I get the variable out of choice? At the moment I have the 'do' setup, but I have ...

Powershell 2.0 - Running scripts for the command line call vs. from the ISE

Hi, After writing deployment scripts from within the ISE, we need our CI server to be able to run them automatically, i.e. from the command line or via a batch file. I have notice some significant differences between the following calls: powershell.exe -File Script.ps1 powershell.exe -Command "& '.\Script.ps1'" powershell.exe .\Script...

how to use aspell in cmd line

i need to use aspell or any other spell checking in cmd line program i need to check for an single word only not on a file.... ...

Server side command line queuing

Is it possible to have a server side program that queues and manages processes that are executed at the command line? The project I am working on takes an image from the user, modifies the image then applies it as a texture to a 3D shape. This 3D scene is generated by blender/Cinema 4d at the command line which outputs it as an image. I...

Temporary PYTHONPATH in Windows

How do I set, temporarily, the PYTHONPATH environment variable just before executing a Python script? In *nix, I can do this: $ PYTHONPATH='.' python scripts/doit.py In Windows, this syntax does not work, of course. What is the equivalent, though? ...

Text piped to PowerShell.exe isn't recieved when using [Console]::ReadLine()

I'm getting itermittent data loss when calling .NET [Console]::ReadLine() to read piped input to PowerShell.exe. In CMD, run: >ping localhost | powershell -NonInteractive -NoProfile -C "do {$line = [Console]::ReadLine(); ('' + (Get-Date -f 'HH:mm :ss') + $line) | Write-Host; } while ($line -ne $null)" 23:56:45time<1ms 23:56:45 23:56:46...

How to pack a Chrome extension on Mac OSX with commandline??

Hi I am trying to automate my Chrome extension building process on OSX 10.5. I am unable to find a similar command for OSX like this for Windows chrome.exe --pack-extension=c:\myext --pack-extension-key=c:\myext.pem Is it even possible on OSX? As there is no mention of it in the documentation. Please guide me. Thanks in advanc...

How to automate a build for a Visual FoxPro project?

I'm interested in figuring out how to automate a build from Visual FoxPro similar to how we can build .NET projects from the command line using MSBuild. It seems that it is possible to pass command line arguments to VFP.exe which may include the ability to specify some initial startup prg that runs however it is unclear how well starti...

Python command line UI

Hey guys/gals I'm writing a python script that fixes some duplicate issues on my database. I would like to display some progress status to the users, currently I just print it like this: print "Merged " + str(idx) + " out of " + str(totalCount); The problem is that it prints that in a new line for every record and that does not look s...

How to run php script on server through command line

Hi, I have created a php script to import rss feed into the database. The feed which is huge (from year 2004 to 2010, approx 2 million records) has to be inserted into the database. I have been running the script in browser but the pace it is inserting (approx. 1 per second) i doubt it takes another 20-25 days to input this data even if...

MYSQL: Checking datafile being used from the command line

i am having trouble configuring mysql database to connect to the right file. I do not know which datafile is being used (due to some pretty tricky EC2 related moving around), My question is: from the command line, how do i see what datafile is being used by the mysql database? ...

How to "grep" out specific line ranges of a file

There are often times I'll grep -n whatev file to find what I'm looking for. Say the output is 1234: whatev 1 5555: whatev 2 6643: whatev 3 If I want to then just extract the lines between 1234 and 5555, is there a tool to do that? For static files I have a script that does wc -l of the file and then does the math to split it out wi...

How to get around the command line length limit?

I've been working on a small and simple program that I drop files onto and, based on certian rules, they are moved to diffrent places. The program works fine unless I drop more than a few files, then it kicks back an error (that appears to be more Windows than anything) that the start up command "c:\myapp.exe \file \file \file" is too l...

Creating a variable-speed slideshow based on USB input on OSX.

I have a friend who is trying to put together a geeky little contraption for a wedding, where people can view a slideshow. Neither of us use Macs, nor have programmed for one, but for various reasons it has to run on a Mac. There will be a USB ammeter hooked up to a bike dynamo. What we want is for a slideshow to be run, and advance at ...

findstr regex search

I need to retrieve some value based on regular expression using findstr but findstr returns the whole line. Is there any way to change it? ...

End marker for command line arguments

I'm writing a program which takes filenames and options on the command line in the usual way, and also can be directed to read arguments from a file. I'm implementing the semi-standard -- to turn off special treatment of subsequent arguments, and # as comment marker. I also want to implement a marker for 'disregard all arguments from he...

Jar not found when executing class

Hi there, I'm working through a ANTLR (a language processing library) book and there are many examples that should be easy to compile using the command line. Some information to get te problem: antlr-3.2.jar contains the library classes. I added the antlr-3.2.jar to the CLASSPATH environment variable (Windows 7) and when compiling th...